GithubHelp home page GithubHelp logo

Comments (2)

brian-ixlayer avatar brian-ixlayer commented on June 5, 2024

The use case for extra_env_vars is for merging extra environment variables on top of the default ones if you need to do so. You would add these in your {env}.tfvars file like so:

extra_env_vars = [
    {
        name = "MY_ENV_VAR"
        value = "my-value"
    }
]

If you want to add sensitive data that should not be committed to code, there are a few options:

  • ideally you can use the boto3 library or some other wrapper to call secrets rather than passing them to your task definition (link). In my example project in this repo I use aws-secretsmanager-caching which is maintained by AWS
  • Add a secrets manager secret to your container as an environment variable (link)
  • use the extra_env_vars to add a value that you can safely commit to the .tfvars file like I have shown above
  • if you want to put the value in GitHub secrets then you will need to pass it down through the application from the top level main.tf file down to the web module. So you need to add it to the .vars files. I assume you are not using my Terraform modules directly but instead are using your own modules. Then you can change them as you need to support adding extra environment variables through environment secrets. You would also need to update the GitHub Actions scripts to inject the TF_VARS_ env vars to the step that runs terraform plan/apply

Let me know if you have any other questions about these suggestions, hope that helps!

from django-step-by-step.

pdang29 avatar pdang29 commented on June 5, 2024

Thanks for the suggestions, I was able to get it to work using secret manager. Thanks again!

from django-step-by-step.

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.