You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Terraform Initialize
terraform init
Observation:
1) Initialized Local Backend
2) Downloaded the provider plugins (initialized plugins)
3) Review the folder structure ".terraform folder"# Terraform Validate
terraform validate
Observation:
1) If any changes to files, those will come as printed in stdout (those file names will be printed in CLI)
# Terraform Plan
terraform plan
Observation:
1) No changes - Just prints the execution plan
# Terraform Apply
terraform apply
[or]
terraform apply -auto-approve
Observations:
1) Create resources on cloud
2) Created terraform.tfstate file when you run the terraform apply command
Step-07: Access Application
Important Note: verify if default VPC security group has a rule to allow port 80
# Terraform Destroy
terraform plan -destroy # You can view destroy plan using this command
terraform destroy
# Clean-Up Files
rm -rf .terraform*
rm -rf terraform.tfstate*
Step-10: Additional Observations - Concepts we will learn in next section
EC2 Instance created we didn't associate a EC2 Key pair to login to EC2 Instance
Terraform Resource Argument - Key Name
AMI Name is static - How to make it Dynamic ?
Use Terraform Datasources concept
We didn't create multiple instances of same EC2 Instance
Resource Meta-Argument: count
We didn't add any variables for parameterizations
Terraform Input Variable Basics
We didn't extract any information on terminal about instance information
Terraform Outputs
Create second resource only after first resource is created
Defining Explicit Dependency in Terraform using Resource Meta-Argument depends_on
WE ARE GOING TO LEARN ALL THE ABOVE CONCEPTS IN NEXT SECTION