Git Product home page Git Product logo

Comments (2)

d3adb5 avatar d3adb5 commented on May 25, 2024

Instead of setting enabled to false, since you're working with workspaces you can have the default workspace house the state for the backend, and after bootstrap work simply with other workspaces. Then, set enabled as follows:

module "terraform_state_backend" {
  enabled = terraform.workspace == "default"
  source  = "cloudposse/tfstate-backend/aws"
  version = "0.38.1"
  # ...
}

This way, the module will set the count argument of every resource block it uses to 0, turning them into no-ops. Additionally, if you want to avoid provisioning infrastructure of your own save for the one supporting the S3+DynamoDB backend, you can separate the rest of your configuration into a module and use count:

module "rest_of_my_config" {
  # Avoid creating anything within if we're in the default workspace.
  count = terraform.workspace == "default" ? 0 : 1
  # ...
}

from terraform-aws-tfstate-backend.

Nuru avatar Nuru commented on May 25, 2024

The module creates an S3 backend to be used by Terraform. Usually this is done once per company/organization, so I do not understand why you are trying to create one per workspace.

Whether or not you are using workspaces, it is your responsibility to ensure you are not creating duplicate resources by using different inputs for different instantiations of this module. This module provides several inputs you can use to vary the name of created resources:

  • namespace
  • tenant
  • environment
  • stage
  • name
  • attributes

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.