Git Product home page Git Product logo

Comments (6)

osterman avatar osterman commented on June 5, 2024

@rtomlinson-latacora this sounds like maybe you're initializing the state backend, but then not importing the state. Please note this workflow is different from every other terraform module invocation. We have documented the process here: https://github.com/cloudposse/terraform-aws-tfstate-backend#usage and we've scripted it here: https://github.com/cloudposse/terraform-root-modules/blob/master/aws/tfstate-backend/scripts/init.sh

Basically, the process is you provision the backends using terraform but without remote state. Then you re-run terraform init with backends configured and it will prompt to import the backend state to S3.

from terraform-aws-tfstate-backend.

rtomlinson-latacora avatar rtomlinson-latacora commented on June 5, 2024

@osterman If I'm understanding this correctly, the point of the script is to make the backend resources part of state. That is effectively what the second terraform init is doing. All resources that you later add, will also be a part of this state. You have one state file which has the backend resources plus anything else you add to your deployments. Thank you for your time btw

from terraform-aws-tfstate-backend.

osterman avatar osterman commented on June 5, 2024

That's sounds correct. One backend can be shared by multiple projects. Just use different key prefixes (e.g. us-west-2/vpc/terraform.tfstate). We recommend using one bucket per AWS account. Also, for true terraform-HA don't even share the bucket across regions.

from terraform-aws-tfstate-backend.

rtomlinson-latacora avatar rtomlinson-latacora commented on June 5, 2024

Okay, I think I'm sorta understanding how you would namespace the other backends. I'll just do a little experiment to confirm. Since you're storing the state file that manages the dynamodb and bucket for the backend itself in said bucket, you'd obviously run into problems when trying to delete the backend. And since deleting the backend shouldn't need to occur often I'm assuming that this is just a management cost that you'd have to deal with in the event that you actually need to do something with the backend.

from terraform-aws-tfstate-backend.

osterman avatar osterman commented on June 5, 2024

@rtomlinson-latacora here's the process of destroying the bucket: https://github.com/cloudposse/terraform-root-modules/blob/master/aws/tfstate-backend/scripts/destroy.sh

from terraform-aws-tfstate-backend.

osterman avatar osterman commented on June 5, 2024

@rtomlinson-latacora thanks for reporting your issues with the coldstart process and destruction. If you have further issues, please let us know! I'm going to close this issue for now.

from terraform-aws-tfstate-backend.

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.