terraform import aws instance.my foo i-abcd1234

From wikieduonline
Revision as of 19:43, 22 June 2022 by Welcome (talk | contribs) (→‎Errors)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

terraform import aws_instance.YOUR_NAME i-00b1cf99a8fd118aa
aws_instance.YOUR_NAME: Importing from ID "i-00b1cf99a8fd118aa"...
aws_instance.YOUR_NAME: Import prepared!
  Prepared aws_instance for import
aws_instance.YOUR_NAME: Refreshing state... [id=i-00b1cf99a8fd118aa]

Import successful!

The resources that were imported are shown above. These resources are now in
your Terraform state and will henceforth be managed by Terraform.


Errors

terraform import aws_instance.your_name i-00b1cf99a8fd118aa
Error: resource address "aws_instance.your_name" does not exist in the configuration.

Before importing this resource, please create its configuration in the root module. For example:

resource "aws_instance" "your_name" {
  # (resource arguments)
}

Related

See also

Advertising: