#atlantis (2021-07)
Discuss the Atlantis (<http://runatlantis.io | runatlantis.io>) |
**Archive: ** https://archive.sweetops.com/atlantis/
2021-07-07
Hey question about Atlantis checks, we’re experiencing an issue where after an apply is run, even after there are errors in stdout
the apply check marks as successful, is this behaviour expected?
Nope.
We’re using a Terragrunt worfklow.
apply:
steps:
- env:
name: TERRAGRUNT_TFPATH
command: 'echo "terraform${ATLANTIS_TERRAFORM_VERSION}"'
- run: terragrunt apply-all -no-color --terragrunt-parallelism 4 --terragrunt-non-interactive | grep -v 'terragrunt'
Yeah, because you are using $action-all which fucks with stdout
Ah lame =(
Maybe alluring, but really not safe.
Thanks for the quick response @joshmyers! Very alluring, but yes, we recognise that it’s not good practice. Originally was using it for larger deployments that were modular, so we were creating atlantis projects to run the commands with the dependencies
block. Since moved away from that but still using the same workflow
Easy fix, thanks again
@joshmyers do you use -auto-approve
flag in your workflow that doesn’t have the *-all
?
2021-07-08
hey, i have a project that uses .tfvars files, a file per environment. Each environment uses it’s own backend stored in the same account as all other resources. What would be a good way to do terraform init
for each environment and pass different configuration?
i guess this section of docs applies here https://www.runatlantis.io/docs/custom-workflows.html#custom-backend-config however I’m not sure how the content of custom backend file
would look like, ant pointers please?
please ignore the question, it’s just standard terraform backend config file
2021-07-28
Hey There, We are currently using Terragrunt for Atlantis workflow and recently updated the Atlantis image to the latest one. Now, when we try to do a plan, it succeeds and shows the plan out put as:
but, when we try to comment the apply command it throws 2 different types of errors:
- When you just comment “atlantis apply”
Ran Apply for 0 projects:
- When you comment “atlantis apply -d test/myproject”, it throws the following error ``` exit status 1: running “terragrunt apply -no-color $$PLANFILE” in “/home/atlantis/.atlantis/repos/myrepo/myproject”:
Error: Failed to load “2408PLANFILE” as a plan file
Error: stat 2408PLANFILE: no such file or directory time=2021-07-28T17:40:15Z level=error msg=1 error occurred: * exit status 1 ```
I have no seen this
and that showing the name of the planfile is weird
that about the atlantis logs?
atlantis checkout the repo and the repo becomes the working directory
so when the plan is done is where the plan file will be safe UNLESS you have custom command or custom plan that outputs the plan file to another directory
so, I kinda of gotten it to work. The issue looks like was caused from having $$PLANFILE
changed it to $PLANFILE
and it worked fine
No, we dont have any custom commands or plans configured output. This what we have as workflow steps:
terragrunt plan -no-color -out $PLANFILE
terragrunt apply -no-color -out $PLANFILE
so you do have a custom workflow
in my atlantis setups I never expecified the PLANFILE
anyone faced something like this before? or any pointers on what I should be looking at?
so, I started up atlantis for my terraform code base, it was working fine… Now I am getting this error on init
Error: Failed to install provider from shared cache
How do I resolve it? Do I really just not commit the lock files like threads are suggesting, seems broken.
The weird thing is, it worked for a few plans/PR’s/commits and now its coming up with this.
ok, so I think its because I moved to a custom image and installed openssl.
I have deleted the cache and this plan has run, I will let you know if another plan has worked.
so yeah, a second plan using the downloaded cache now fails again.
ok, so what is atlantis doing, I can see its running update and adding hashes to the lock file….
got it
terraform providers lock -platform=linux_amd64 -platform=darwin_amd64
Atlantis just run terraform
nothing else
no magic
True, Atlantis just runs Terraform, so you can try runing TF code yourself. If you experience the same behaviour then something is wrong with TF install or perms. That could be the issue also in case of custom built Atlantis image.