Terraform Script without ami id for aws ec2 instance


Can we spin EC2 instance without Ami id for AWS cloud?

Hi @shub0145,

An AMI is a definition of one or more disk images to use when creating the virtual disks attached to your EC2 instance, so an EC2 instance without an AMI would presumably not have any disks and thus it would be unable to boot. As far as I know, there is no way to start an EC2 instance without selecting an AMI.

Someone in this forum with more EC2 familiarity might be able to give further advice here if you can explain what you were hoping to achieve by creating an EC2 instance without an AMI. There might be some other way to achieve your goal, if you can explain the problem itself rather than asking about a specific solution you’re trying.

thank you…

To be more Specific my purpose is to launch EC2 instance RHEl 7 which does not have ami id , and i am wanting to launch via terraform script