I'm creating an EC2 instance and loading it up with some "on start" scripts as well as installing desired software. This becomes the base image to be used when spinning up new instances.
Once created, I create an AMI. At this point, there is no need to keep the EC2 image used to create the AMI.
So, the sequence is:
Create EC2
Install packages
Configure packages
Create AMI
Destroy EC2
How do I tell Terraform to then delete the EC2 in the final step?
terraform destroy -target aws_instance.NAMEcommand to destroy your instance. - Adil B