orange-cloudfoundry / cf-ops-automation

a collaboration framework for operating cloudfoundry and services at scale
22 stars 6 forks source link

terraform resources refactorings currently need manual work to prevent deleting existing infras #20

Open gberche-orange opened 6 years ago

gberche-orange commented 6 years ago

We would need to automate invocation of "terraform state mv" when the tf configuration changes impact resources that should be preserved on infra.

Background:

Uses cases:

Some potential inspirations:

gberche-orange commented 6 years ago

To possible way add built-in support could be to manage the refactoring steps as terraform modules that produce bash migration scripts on the local disk using the https://www.terraform.io/docs/providers/local/r/file.html resource, and then invokes them on the terraform state. The tracking of the execution of the refactoring commands might require a distinct tfstate file.

Since our goal is to share this logic with the community as reusable concourse resource, I initiated a related discussion into https://github.com/ljfranklin/terraform-resource/issues/41