Comments (9)
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.
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.
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.
@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.
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.
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.
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.
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.
This issue was migrated to runatlantis/atlantis#26. Read about why here.
from atlantis.
Related Issues (20)
- Update README and website with new GitLab docs
- Support Terraform 0.11.0
- Document slack integration HOT 1
- Where are .tfstate and .tfstate.backup stored? HOT 3
- Bridging Packer and Terraform HOT 4
- Expired Certificate (atlantis.run) HOT 2
- Use GitHub protected branches to gate atlantis apply's HOT 9
- proxy support HOT 2
- Fix circleci tagging and pushing HOT 2
- Built-in SSL support? HOT 1
- GitLab - Issue when passing --gitlab-hostname param HOT 3
- Release 0.2.4 with GitLab bug fix HOT 1
- [feature] Redact / Mask atlantis output HOT 2
- [feature] Protect atlantis.yaml HOT 11
- Execute pre/post commands from inside project root HOT 1
- Atlantis support for github Oauth HOT 3
- Payload signature check failed HOT 3
- Data directory needs to be absolute HOT 1
- There is a way to disable apply? HOT 5
- Document security vulnerability reporting HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from atlantis.