Import an existing resource, two ways?
IntermediateProductionRapid-Fire Commands
Answer
terraform import aws_s3_bucket.logs acme-logs
or declare it in code (1.5+) and run terraform plan -generate-config-out=gen.tf:
import { to = aws_s3_bucket.logs id = "acme-logs" }
More on Rapid-Fire Commands
Format all files recursively and fail if anything needs formatting?BeginnerList every resource address under one module?BeginnerShow the attributes of one resource in state?BeginnerPlan with a specific var file and write the plan?BeginnerValidate configuration and get machine-readable output?BeginnerApply a saved plan and inspect it as JSON first?Beginner