- https://youtu.be/iRaai1IBlB0
- https://courses.morethancertified.com/p/rfp-terraform
- Course code: https://github.com/morethancertified/rfp-terraform
terraform init
terraform plan
terraform apply
terraform destroy
terraform apply -auto-approve
state is the most important feature in terraform: https://developer.hashicorp.com/terraform/language/state
- to list all items in terraform state:
terraform state list
- To show details for an item from that list:
terraform state show aws_vpc.my_vpc
- To just dump all of the details in the state:
terraform show
ssh-keygen -t ed25519
- save to
C:\Users\jacubic\.ssh\my-awskey
- skipped passphrase
- to verify the files
my-awskey
andmy-awskey.pub
were created, run:ls -al ~/.ssh
get the public IP address from the vm
- get the list of state items:
terraform state list
- show the VM details:
terraform state show aws_instance.dev_node
- find the public IP address
- ssh into it (replace the IP with the real IP):
ssh -i ~/.ssh/my-awskey ubuntu@123.123.123.123
- get the release info
cat /etc/*release
orlsb_release -a
terraform apply -replace aws_instance.dev_node
terraform output