CmdID

CmdID / Commands

terraform-import

Import existing infrastructure into Terraform state. tldr-pages

On several platforms

Opens CmdID with your command. It is read in your browser and sent nowhere.

Several platforms

from tldr-pages, CC BY 4.0

Import an existing resource into Terraform state

terraform import resource_type.resource_name resource_idIdentify

Import a resource into a module

terraform import module.module_name.resource_type.resource_name resource_idIdentify

Import without interactive input prompts (useful for automation)

terraform import -input=false resource_type.resource_name resource_idIdentify

Import with variable values

terraform import -var 'name=value' resource_type.resource_name resource_idIdentify

Import with a variable file

terraform import -var-file=path/to/variables.tfvars resource_type.resource_name resource_idIdentify

Import without state locking (use with caution)

terraform import -lock=false resource_type.resource_name resource_idIdentify