Import resources into Terraform
Problem
Use case , manage infrastructure environments both existing and created from scratch, by same terraform configs. For example in development environments we want to create everything from scratch and destroy everything then we finish working with it. In production we want to be able to add new resources to it with terraform but not conflict with resources that already exist but not managed by terrafrom yet. For ex: [code block] } if terraform has not yet created this resource it will check if subnet_b_id is defined and if resource with such id exists in provider api it will import this resource into terraform based on data in api instead of creating it.
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: Import resources into Terraform
No specific update on the feature itself, it's still on the roadmap. But I wanted to jump in here to link an excellent article by @phrawzty on a strategy for dealing with existing resources with current versions of terraform: https://www.dark.ca/2015/01/27/handling-extant-resources-in-terraform/
Trust Score
2 verifications
- 1
No specific update on the feature itself, it's still on the roadmap.
No specific update on the feature itself, it's still on the roadmap.
- 2
But I wanted to jump in here to link an excellent article by @phrawzty on a stra
But I wanted to jump in here to link an excellent article by @phrawzty on a strategy for dealing with existing resources with current versions of terraform:
- 3
https://www.dark.ca/2015/01/27/handling-extant-resources-in-terraform/
https://www.dark.ca/2015/01/27/handling-extant-resources-in-terraform/
Validation
Resolved in hashicorp/terraform GitHub issue #581. Community reactions: 1 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep