runatlantis / atlantis

Terraform Pull Request Automation
https://www.runatlantis.io
Other
7.68k stars 1.05k forks source link

Atlantis plan does not show the correct output #3995

Open dimitardimovjebbit opened 10 months ago

dimitardimovjebbit commented 10 months ago

Hi,

I have setup Atlantis for my organisation by using the official Terraform module for Atlantis deployment which can be found here https://registry.terraform.io/modules/terraform-aws-modules/atlantis/aws/latest and by using the latest version. I have also setup the webhooks and everything else in Github and all seems to be connected as it should.

The issue I am facing now is that whenever I make a simple change in terraform (for example creating a new S3 bucket) I get atlantis plan output which wants to add ~100 resources and all but the S3 bucket resources are already there.

The current structure of our repository is the following: -Terraform ->modules ->List of modules ... ... ->preprod ->canary ->dev ->shared ->staging ->main.tf ->providers.tf ->prod ->shared ->production ->prodstaging ->main.tf ->outputs.tf ->providers.tf

Any help would be greatly appreciated

brandon-fryslie commented 9 months ago

You can use 3 backticks:

like this (ignore the backslashes, they are just there to prevent parsing the backticks literally): 
\```
my formatted output
\```

to format your output. That might help show your structure more clearly. Also, you don't state which version you're using. you say "latest" so I assume 0.26.0 but it would be helpful to post the exact version.

Have you explored all of the server configuration options? You'll likely need to make some changes there. By guess is that you are not setting some of the options correctly to account for your non-standard terraform layout. Keep in mind that any structure beyond a single directory containing your Terraform files is "non-standard" and will require some additional configuration. Because our layout is also non-standard, we do not rely on Atlantis to detect anything. We have custom code that generates an atlantis.yaml as part of a pre_workflow_hook.