Updated for clarity 4/9/26. The Notion page is in progress. Want to see a better formatted version of this post? Check my Notion!
Created development environment using AWS and Terraform including a route table, internet gateway, security group, public subnet, and EC2 instance, using templates, provisioners, and key generation for remote access.
NEW Concepts Learned
- aws_ami
- A data segment instead of resource that pulls an owner number of an AMI hosted by AWS.
Userdata
Made it a template file, it bootstaps the instance as well as installing the docker engine.
AMI searcher in EC2 Console
Going to search the AMI in the Instance Launcher, then returning to EC2 console to search it for the owner number and other info.
ssh-keygen
I used PuTTy for previous keys.
Terraform’s homemade File function
Reads a text file and injects the contents as a string.
The .tpl extension
Makes templates that map to variables of the main code. If you need to have, for example, EC2 instances with different logins, make this and Call it with templatefile()
More; Templates In Terraform -- A Complete Guide
Provisioners
I think it’s using a EC2 instance terminal on your VS Code local setup, in tandem with SSH tools in VS Code with Remote -SSH. It shouldn’t be done normally, and should always run within another resource.
Terraform has a Console 😲
terraform console
Say it in the tone of that one Tweet where the woman goes ‘Pokemon has a son?’
terraform.tfvars is processed by default

Comments
Post a Comment