Skip to content

blitz-cmd/Terraform

Repository files navigation

Terraform Basics

Initialise the folder to add all the dependencies & configurations

$ terraform init

To format & validate the configurations

$ terraform fmt
$ terraform validate

Get blueprint of configurations

$ terraform plan
$ terraform plan -out=<filename>

To apply the configurations

$ terraform apply
$ terraform apply -auto-approve
$ terraform apply -refresh-only
$ terraform apply -replace="aws_instance.my_server"

Refresh the tf state file

$ terraform refresh

Display output

$ terraform output

Inspect state of configuration

$ terraform show
$ terraform state list

To destroy the config.

$ terraform destroy

Terraform resources

HashiCorp Terraform Associate Certification Course
Terraform Registry Provider AWS Docs
Terraform Basic Docs AWS
Terraform AWS Docs
Terraform Modules
Terraform Cloud
Cloud Init Docs