Git Product home page Git Product logo

Comments (8)

dmattia avatar dmattia commented on August 16, 2024 5

runatlantis/atlantis#1255 has been released in Atlantis v0.16.0, allowing us to run terragrunt-atlantis-config on the Atlantis server side of things.

I'll be updating the documentation of this repo soon with how to use the new features 😄

from terragrunt-atlantis-config.

tsunamishaun avatar tsunamishaun commented on August 16, 2024 2

@angeloskaltsikis the post wasn't entirely clear on how to setup the post-clone git hook, I ended up putting the core.hooksPath in /etc/gitconfig with /home/atlantis/hooks as the path. Though I am using the new pre-workflow feature of atlantis it doesn't consistently run for subsequent workspaces, making my atlantis.yaml not clone into each workspace directory. I am using both methods now and things appear stable, would love to keep the conversation going and see what you come up with @dmattia.

My use case is for multi account and by passing in account name I'm able to generate the config just for the instance of atlantis set for the account. This line is in my root terragrunt.hcl (hopefully it helps someone else):

locals {
  atlantis_skip = get_env("ATLANTIS_ENABLED_ACCOUNTS", "") == local.account_name ? false : true
}

It does mean that bad configs will break everything and that there is no way to ignore a directory (per the way I am parsing the environment variable, suggestions welcome!).

from terragrunt-atlantis-config.

michaelfarrell76 avatar michaelfarrell76 commented on August 16, 2024 1

the plan for this is atlantis is adding a feature to allow for pre-workflow custom hooks

see the issue
and the open pr

from terragrunt-atlantis-config.

michaelfarrell76 avatar michaelfarrell76 commented on August 16, 2024

for now would recommend committing the atlantis.yaml until that is merged

from terragrunt-atlantis-config.

ishallbethat avatar ishallbethat commented on August 16, 2024

I'm looking at "terragrunt-atlantis-config using github action to validate atlantis.yaml" . I'm not sure it's a way to achieve what i need. @michaelfarrell76

from terragrunt-atlantis-config.

angeloskaltsikis avatar angeloskaltsikis commented on August 16, 2024

@IamGabrielWu You can follow the method described in this medium post till the PR of having pre-workflow custom hooks is merged.

I would advise against committing as you will have each user run the current project
cc. @michaelfarrell76

from terragrunt-atlantis-config.

dmattia avatar dmattia commented on August 16, 2024

I'm going to close this, but feel free to open if you have any other questions.

To summarize:

  • you can keep committing atlantis.yaml to github
  • @angeloskaltsikis has a very nice solution you can migrate to now to not need to commit
  • fairly soon, atlantis should support hooks that are another option for not needing to commit

from terragrunt-atlantis-config.

kitos9112 avatar kitos9112 commented on August 16, 2024

Many thanks @tsunamishaun for sharing the above code snippet. It has just solved the first impediment I was facing with this fantastic tool to generate the atlantis.yaml - Although, I slightly modified the Terraform built-in function as I didn't bother about hardcoding the name of my AWS workload in the top-level terragrunt.hcl:

locals {
  (...)
  atlantis_skip = contains(["dev"], local.aws_account_workload) ? false : true
}

At the moment, we only let Atlantis run in our AWS development account so we can take careful decisions about moving code into other more sensitive environments by leveraging a dedicated GitLab runner.

I even think it should be clearly indicated in the README.md of this project given the fact it also works despite utilising the CLI flag --ignore-parent-terragrunt:

How to limit the automatic generation of an atlantis.yaml configuration for a well-known Terragrunt directory-driven layout:

account
 └ _global
 └ region
    └ _global
    └ environment
       └ resource

from terragrunt-atlantis-config.

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.