DELAPARRA
Index
Color
NL
Category: Terraform

import

Explained by Updated

What is import?

import: Brings an existing real-world resource under Terraform management by writing it into state. terraform import brings an existing resource under Terraform's management. You write the resource block in your configuration, then import the real object into state, as in terraform import aws_s3_bucket.logs my-app-logs. It is how you adopt infrastructure that was created by hand or by another tool, without deleting and recreating it.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about import

What should you keep in mind with import?

After importing, run terraform plan. Any differences between your written configuration and the real resource show up as proposed changes. Adjust the code until the plan shows nothing, so Terraform does not modify the resource unexpectedly. Newer Terraform versions also support import blocks in configuration, which can be reviewed in a pull request and can even generate the starting configuration for you.

What does an example of import look like?

terraform import aws_s3_bucket.logs my-app-logs

At a glance

CategoryTerraform
Explained by
Updated

More Terraform terms

All terms starting with I

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.