Git Product home page Git Product logo

Comments (9)

swladyka avatar swladyka commented on August 21, 2024

I like the option with .atlantisignore files very much, would be very helpful when working with terraform modules and having templates in a separate directory.

from atlantis.

anubhavmishra avatar anubhavmishra commented on August 21, 2024

yea for sure. Currently, atlantis ignores certain folders ex: _modules/ and modules/ by default but we want to extend this. https://github.com/hootsuite/atlantis/blob/master/server/plan_executor.go#L196

from atlantis.

johntdyer avatar johntdyer commented on August 21, 2024

So it seems like the fix in this ticket aws to rename your module folder to "_modules" or "modules" which would ignore them. However it looks like #211 changed this behavior.... Any chance you guys could re-evaluate the .atlantisignore suggestion ?

from atlantis.

lkysow avatar lkysow commented on August 21, 2024

@johntdyer is the issue you're having that Atlantis is running plan in the parent directory of modules/? If so, I've fixed this in the new repo here: runatlantis/atlantis#13. I'm working on Atlantis under that repo now and will soon be updating the tickets/README of this repo accordingly (if you're wondering why I've explained here). You can grab the latest release here: https://github.com/runatlantis/atlantis/releases

Does that change fix your issue or is there something else happening?

Regarding .atlantisignore, here's the direction I want to go:

  • in an upcoming release of Atlantis, we'll support automatically running plan on a new pull request
  • if there's no atlantis.yaml in the repo, then we'll attempt to figure out where to run plan following the current logic
  • if there is an atlantis.yaml, then you can configure where we run plan and on what changes using some new config options:
version: 2
pipelines:
  plan:
    on_push:
      enabled: true
      when_modified: ["*.tf", "../../modules/**/*.tf"] # If a modified file matches then we'll run plan in this project. Uses .gitignore syntax. It's optional, if not specified then will default to ["*.tf", "**/*.tfvars"].

So long-story short, you could use the when_modified key to achieve the same behaviour as .atlantisignore. Would that work for you? Thanks!

from atlantis.

johntdyer avatar johntdyer commented on August 21, 2024

Thanks for the update. So, yes this would work. Thanks for the update. Any idea on when we can expect this new behavior ?

from atlantis.

lkysow avatar lkysow commented on August 21, 2024

The new behaviour is being worked on right now but I can't give you an accurate ETA. There's a lot of features being considered for the next release: https://docs.google.com/document/d/13if7Bma_uTF1nhvdKx-vpU5ASakmPt-EfPSo3epv7JQ/edit#

Can you elaborate on why having the ability to run atlantis plan -d . isn't enough? That way I can make sure the new feature will fit your configuration.

from atlantis.

johntdyer avatar johntdyer commented on August 21, 2024

Right now when I run atlantis plan -d . I get the following


Ran Plan in 2 directories:

  • _
  • sns_to_spark_lambda

_/

Plan Error

chdir /home/atlantis/.atlantis/repos/tropo-operations/tropo-terraform/66/default/_: no such file or directory: running "sh -c terraform init -no-color" in "/home/atlantis/.atlantis/repos/tropo-operations/tropo-terraform/66/default/_": 


sns_to_spark_lambda/

Plan Error

exit status 1: running "sh -c terraform plan -refresh -no-color -out /home/atlantis/.atlantis/repos/tropo-operations/tropo-terraform/66/default/sns_to_spark_lambda/default.tfplan -var atlantis_user=johndye -d ." in "/home/atlantis/.atlantis/repos/tropo-operations/tropo-terraform/66/default/sns_to_spark_lambda": 
flag provided but not defined: -d
Usage: terraform plan [options] [DIR-OR-PLAN]

  Generates an execution plan for Terraform.

  This execution plan can be reviewed prior to running apply to get a
  sense for what Terraform will do. Optionally, the plan can be saved to
  a Terraform plan file, and apply can take this plan file to execute
  this plan exactly.

  If a saved plan is passed as an argument, this command will output
  the saved plan contents. It will not modify the given plan.

Options:

  -destroy            If set, a plan will be generated to destroy all resources
                      managed by the given configuration and state.

  -detailed-exitcode  Return detailed exit codes when the command exits. This
                      will change the meaning of exit codes to:
                      0 - Succeeded, diff is empty (no changes)
                      1 - Errored
                      2 - Succeeded, there is a diff

  -input=true         Ask for input for variables if not directly set.

  -lock=true          Lock the state file when locking is supported.

  -lock-timeout=0s    Duration to retry a state lock.

  -module-depth=n     Specifies the depth of modules to show in the output.
                      This does not affect the plan itself, only the output
                      shown. By default, this is -1, which will expand all.

  -no-color           If specified, output won't contain any color.

  -out=path           Write a plan file to the given path. This can be used as
                      input to the "apply" command.

  -parallelism=n      Limit the number of concurrent operations. Defaults to 10.

  -refresh=true       Update state prior to checking for differences.

  -state=statefile    Path to a Terraform state file to use to look
                      up Terraform-managed resources. By default it will
                      use the state "terraform.tfstate" if it exists.

  -target=resource    Resource to target. Operation will be limited to this
                      resource and its dependencies. This flag can be used
                      multiple times.

  -var 'foo=bar'      Set a variable in the Terraform configuration. This
                      flag can be set multiple times.

  -var-file=foo       Set variables in the Terraform configuration from
                      a file. If "terraform.tfvars" or any ".auto.tfvars"
                      files are present, they will be automatically loaded.

flag provided but not defined: -d
Usage: terraform plan [options] [DIR-OR-PLAN]

  Generates an execution plan for Terraform.

  This execution plan can be reviewed prior to running apply to get a
  sense for what Terraform will do. Optionally, the plan can be saved to
  a Terraform plan file, and apply can take this plan file to execute
  this plan exactly.

  If a saved plan is passed as an argument, this command will output
  the saved plan contents. It will not modify the given plan.

Options:

  -destroy            If set, a plan will be generated to destroy all resources
                      managed by the given configuration and state.

  -detailed-exitcode  Return detailed exit codes when the command exits. This
                      will change the meaning of exit codes to:
                      0 - Succeeded, diff is empty (no changes)
                      1 - Errored
                      2 - Succeeded, there is a diff

  -input=true         Ask for input for variables if not directly set.

  -lock=true          Lock the state file when locking is supported.

  -lock-timeout=0s    Duration to retry a state lock.

  -module-depth=n     Specifies the depth of modules to show in the output.
                      This does not affect the plan itself, only the output
                      shown. By default, this is -1, which will expand all.

  -no-color           If specified, output won't contain any color.

  -out=path           Write a plan file to the given path. This can be used as
                      input to the "apply" command.

  -parallelism=n      Limit the number of concurrent operations. Defaults to 10.

  -refresh=true       Update state prior to checking for differences.

  -state=statefile    Path to a Terraform state file to use to look
                      up Terraform-managed resources. By default it will
                      use the state "terraform.tfstate" if it exists.

  -target=resource    Resource to target. Operation will be limited to this
                      resource and its dependencies. This flag can be used
                      multiple times.

  -var 'foo=bar'      Set a variable in the Terraform configuration. This
                      flag can be set multiple times.

  -var-file=foo       Set variables in the Terraform configuration from
                      a file. If "terraform.tfvars" or any ".auto.tfvars"
                      files are present, they will be automatically loaded.


from atlantis.

lkysow avatar lkysow commented on August 21, 2024

Ahh sorry, you need to pull the latest release from here: https://github.com/runatlantis/atlantis
Atlantis is being maintained in that repo now (you can read why here) and I will be moving these issues over shortly. Sorry for the confusion, I forgot what repo this issue was in!

from atlantis.

atlantisbot avatar atlantisbot commented on August 21, 2024

This issue was migrated to runatlantis/atlantis#26. Read about why here.

from atlantis.

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.