terraform demo for ssh access to ec2
- https://medium.com/@hmalgewatta/setting-up-an-aws-ec2-instance-with-ssh-access-using-terraform-c336c812322f
- https://medium.com/@christyjacob4/using-vscode-remotely-on-an-ec2-instance-7822c4032cff
- https://www.youtube.com/watch?v=yrFcA7GuB0g
Below are instructions for setting up and using Docker.
- Build docker file
docker build --rm -t tf-tool -f tf-tool.Dockerfile .
- Run container in terminal
docker run --rm -it --mount type=bind,target=//root/code,source=/"$(pwd)" tf-tool
- Exit container
exit
These commands should be entered into the tf-tool Docker container terminal.
- Navigate to the terraform folder
cd code/terraform-iac
- Initialize terraform
terraform init
- Plan terraform to spot issues before creating
terraform plan
- Build
terraform apply
- Destroy
terraform destroy