Giter VIP home page Giter VIP logo

Comments (3)

minamijoyo avatar minamijoyo commented on June 13, 2024

Hi @WVan, Thank you for sharing your use-case!

It looks like a problem similar to #36. It had been implemented in #37, but it was recently deprecated in #63 due to a change in Terraform 1.1. At time of this writing with the latest tfmigrate v0.3.0 + Terraform v1.1.0, there is no perfect single solution due to some technical constraints.

Knowing that not all use cases can be covered, but the following might be help:

  • For renaming a resource address in a single tfstate, use a new moved block introduced in Terraform 1.1. See https://www.hashicorp.com/blog/terraform-1-1-improves-refactoring-and-the-cloud-cli-experience
  • For moving a resource accross two tfstates, use a multi_state migration in tfmigrate and not to include other normal configuration changes in a single pull request.
  • For importing or removing a resource in a single tfstate, use a state migration in tfmigrate with setting a force attribute to true, which allows you to apply migration even if it contains some plan changes, finally run a normal terraform apply to converge changes.

A native plannable import feature has been proposed in the upstream, but not implemented yet. hashicorp/terraform#26364

from tfmigrate.

minamijoyo avatar minamijoyo commented on June 13, 2024

After thinking about how to implement a pipeline, you may simplify them into the 3rd case because your pipeline already has a step for an approval before terraform apply, which allows you to review changes ignored by tfmigrate apply with the force attribute.

from tfmigrate.

minamijoyo avatar minamijoyo commented on June 13, 2024

I'm going to close this because there has been no activity on this recently. Please feel free to reopen this if you have any questions or suggestions. Thanks!

from tfmigrate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.