Larryc, Your instructor has apparently never had to deal with autoscaling.
Partha, one of the most common approaches is to put, in whatever golden image you are deploying with, a registration key and an init script that ensures the fully qualified hostname is set consistently, installs chef-client, and uses a local copy of a "validation" key to register the client, then deletes the validation key and the init script. Because the key can register a host with Chef, it needs to be handled securely and
Sadly, that "fully qualified hostname" can get very confusing. Many Linux environments put the hostname into /etc/hosts as "127.0.0.1 myhost myhost.mydomain localhost.localdomain localhost" or something like that, And this causes the "hostname --fqdn" command to respond with "myhost", and under various configurations, that "myhost" will be the name Chef registers with. So cleaning up /etc/hosts into something sane is a critical, critical step. in setting up a new host.
You can make the script cuter and more idempotent, but there is a danger of spending too much time and re-registering the same host twice if you make a mistake. Ideally, installing these one-time-only setup scripts is laid on top of the golden image before you release it for deployment. The alternative is to build it into whatever tools you use to activate the hosts in the first place as part of a scripted operation.
Either way, you'll want to audit your deployed hosts for correct chef registration when done.