Difference between revisions of "Terraform import"
Jump to navigation
Jump to search
↑ https://www.terraform.io/docs/cli/import/index.html
(→Errors) |
(→Errors) |
||
Line 20: | Line 20: | ||
aws_identitystore_user.testimport: Refreshing state... [id=testimport] | aws_identitystore_user.testimport: Refreshing state... [id=testimport] | ||
╷ | ╷ | ||
− | │ Error: reading [[AWS SSO Identity Store User]] (testimport): expected a [[resource id]] in the form: identity-store- id/user-id | + | │ Error: reading [[AWS SSO Identity Store User]] (testimport): expected a [[resource id]] in the form: identity-store-id/user-id |
│ | │ | ||
│ | │ |
Revision as of 16:48, 27 February 2023
Before using terraform import
you must manually write a resource configuration block for the resource.
Contents
Examples
terraform import --help
terraform import aws_instance.my_foo i-abcd1234
[1]terraform import aws_default_subnet.public_subnet subnet-9d4a7b6c
terraform import aws_default_vpc.default vpc-a01106c2
Errors
aws_identitystore_user.testimport: Importing from ID "testimport"... aws_identitystore_user.testimport: Import prepared! Prepared aws_identitystore_user for import aws_identitystore_user.testimport: Refreshing state... [id=testimport] ╷ │ Error: reading AWS SSO Identity Store User (testimport): expected a resource id in the form: identity-store-id/user-id │ │ ╵
Errors
terraform import aws_key_pair.MyNewKeyInTerraform YourExistingKeyName
terraform import aws key pair.MyNewKeyInTerraform YourExistingKeyName2
Error: Reference to undeclared resource
Related terms
- Terraform modules
- Terraform resources:
resource
terraform.tfstate
- Terraform activities
terraform apply -refresh-only
- Cloudformation:
--resources-to-import
See also
- Terraform configuration files, Terraform state files:
.tf
,.tfvars
,main.tf, outputs.tf
,variables.tf
,.terraform.d/
,terraform init
,providers.tf
,.terraform/
,terraform.tfstate
,.terraform.lock.hcl
,terraform.tfstate.d, override.tf, versions.tf
terraform
[untaint | fmt
|apply
|show
|state
|init | plan | console | output
|validate
|destroy
|debug
|import
|providers
|get
|graph
|workspaces
|resource
|login
|-var-file
|state mv
|state pull
|state push
|state replace-provider
|state rm
|force-unlock
|env
|tfe
|--version
|remote-exec
|delete on termination
| deprecated commands |terraform --help
]
Advertising: