Import existing resource

Bring an already-existing resource under Terraform control

terraform import module.path.resource_type.name <remote-id>

tool
terraform43 commands
tags
terraform

More terraform commands

  • terraform state show module.path.resource_type.name

    Inspect Terraform state attributes for a single resource

  • terraform state mv old.address new.address

    Rename/reorganize resource without destroying and recreating it

  • terraform workspace list

    Show all workspaces; current one marked with *

  • terraform workspace new staging && terraform workspace select staging

    Create a new workspace and switch to it

  • terraform validate

    Check Terraform configuration for syntax and consistency errors

all 43 terraform commands