Import existing resource terraform
Bring an existing resource under Terraform management
terraform import 'aws_s3_bucket.mybucket' my-existing-bucket
more terraform
all 43 commands →
Taint resource for recreation
terraform taint 'aws_instance.web[0]'
Remove resource from state
terraform state rm 'aws_instance.legacy'
Show outputs
terraform output -json | jq 'to_entries[] | {(.key): .value.value}'
Destroy specific resource
terraform destroy -target='aws_instance.web' -auto-approve
Unlock stuck state
terraform force-unlock <lock-id>