No key assigned to instance created from Image

I have created an image and assigned it to auto scaling and it is creating a key while building image but it is not assigning the key to the instances created from auto scaling group. It is not assigning even default key also and I am using the latest gem. Sometimes it is not even deleting the instance used for creating Image.

Someone with divination skill may answer …

Sorry, but you’re not giving any clue of what you’re doing with what, are you using chef-provisioning on AWS ? Or is it something totally different ?

Give some more details on what you’re doing, give your gems and version, show your code and show logs so we can try to guess what’s happening please.

Its on chef-provisioning AWS

When using Amazon Auto-Scaling Groups, you’ll need to use the old validator-style bootstrap usually. Bake Chef, a config, and the validator key in to the AMI and have the userdata script (or something else driven from cloud-init) kick off the first chef-client run. You will usually want this first run to also install chef-client as a service.