Workspace create and switch terraform
Create and activate a Terraform workspace
terraform workspace new staging && terraform workspace select staging
more terraform
all 43 commands →
Show dependency graph
terraform graph | dot -Tsvg > graph.svg && open graph.svg
List providers with versions
terraform providers lock -platform=linux_amd64 -platform=darwin_arm64
Move resource in state
terraform state mv 'aws_instance.web' 'aws_instance.app'
Remove orphan from state
terraform state rm 'aws_s3_bucket.legacy'
Inspect single resource state
terraform state show 'module.vpc.aws_subnet.private[0]'