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, filters by name (with
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
For relative file paths for shorter access
The .tpl extension
Makes templates that map to certain sections of the main code. Usually using ${ }
, but that’s also very module-esque, I feel. Call it with templatefile()
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