Difference between revisions of "Terraform import"

From wikieduonline
Jump to navigation Jump to search
Line 53: Line 53:
 
* Cloudformation: <code>[[Cloudformation: --resources-to-import|--resources-to-import]]</code>
 
* Cloudformation: <code>[[Cloudformation: --resources-to-import|--resources-to-import]]</code>
 
* <code>[[terraform state rm]]</code>
 
* <code>[[terraform state rm]]</code>
* [[import]] block allows import operations to be defined in code
+
* <code>[[import]] block allows import operations to be defined in code</code>
  
 
== See also ==
 
== See also ==

Revision as of 11:45, 1 July 2024

Before using terraform import you must manually write a resource configuration block for the resource.

Examples

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
│  
│ 
╵
terraform import aws_identitystore_user.testimport d-9a672d8036/testimport
aws_identitystore_user.testimport: Importing from ID "d-123456789/testimport"...
aws_identitystore_user.testimport: Import prepared!
  Prepared aws_identitystore_user for import
aws_identitystore_user.testimport: Refreshing state... [id=d-123456789/testimport]
╷
│ Error: reading AWS SSO Identity Store User (d-123456789/testimport): operation error identitystore: 
DescribeUser, https response error StatusCode: 400, RequestID: 362370f8-3b16-4d14-9e28-64265f76e1a4, 
ValidationException: 
│ 
│ 
╵

Errors

Related terms

See also

  • https://www.terraform.io/docs/cli/import/index.html
  • Advertising: