Replies: 6 comments 5 replies
-
Greetings! I wanted to provide context to give a detailed write up of how we are trying to deploy terraform compliance and what lead us to your tool. Thanks to your attention to our requests (creating more robust filtering for silent mode, and fixing the "known after apply default values), our potential deployment to our full prod environment is now very close to reality. PLEASE feel free to ask questions for further context or clarity Currently we are in the middle of deploying Atlantis to automate Terraform deployments via Github Pull Request, and are integrating Terraform-Compliance into Atlantis to run in tandem with it. We are running in an environment where Terraform configurations comprised of a blend of total new deployments, updates to existing configurations, and new additions to existing configurations. The missing piece is being able to filter on what type of resource we are dealing with. Details and possible options at the bottom. We feel strongly that this deployment pattern represents a common case in many organizations, where the desire to prevent new compliance failures from being deployed while work is done to bring the rest of the infrastructure up to code. Atlantis serves as an engine that Terraform compliance can be used as a Workflow Here, feature request at the end! Full workflow below, apologies for the long read:
We are taking this deployment one step further and running Github protected branches, so that if any checks fail, the branch is not mergeable. Since Terraform code doesn't work under the same principal as normal production code, where a merge to Essentially Atlantis by itself when run as a check outputs a 0, if:
It will output a 1 if either of the above two requirements are not met When Github protected branches are enabled and checks are enforced, Atlantis output of 1 also blocks **How Atlantis knows what to do ** Atlantis gets its instructions for how to run via an Atlantis has two ways to run an
How we "Hack"Terraform-Compliance into the Atlantis workflow A sample section of a repo lvl Atlantis produces a planfile each time it runs, we ingress that plan into the terraform-compliance installation on the Atlantis host and use it to run, adding in our features repo and a set of awk output filters to make the output display clean and readable. (This filtering would not be possible without the adjustments to silent mode, Thanks again!)
Running Terraform Compliance this way solves several logistical hurdles and adds simplicity and positive user experience.
2.Atlantis enforces terraform state locks, thus making a github action complex since we would need to terraform plan, scan, then release
SAMPLE OUTPUT REPRESENTED on GITHUB PR from above run command in atlantis.yaml -GITBOT PR SNIPPET-
** FEATURE REQUEST TO RUN ONLY ON SPECIFIC RESOURCE CHANGE ACTIONS** Our last request would be to mimic some of the functionality that HashiCorp Sentinel has and be able to differentiate between resources by Change representation:hashicorp link, via the resource changes block and how it relates to the resources you are loading up for scanning by Terraform compliance via the root module. Below as I am sure you know are the change actions:
Many checks that we would like to run can result in odd behaviors and failed checks that should not be fixed at the code level. We would like to run checks on only those resources that are flagged as Without this filtering we need to drastically reduce the number of features we can test against in a Github PR powered by Atlantis above. Situations that create problematic or confusing failures
POSSIBLE SOLUTION SUGGESTIONS # 1. seems technically easier with the existing loop repurposed, but more complicated with limiting and messing with the deepcopy and haystack # 2. may result in an easier way to use the tool without an additional flag or filter since it just adds a new parameter to the mix
Would it be possible to leverage this same type of loop, triggered with an additional output flag for example
Sample Feature leveraging this:
Other features can be written for actions of Also use cases where we are attempting some level of |
Beta Was this translation helpful? Give feedback.
-
@eerkunt i see it looks like you folks are quite busy with some of the indexing issues folks are posting. sorry for my delay in response here. Thanks so much for opening the forum. Please let know is there is a version or some fix you need some testing on. We enjoy testing out capability as we scale and automate our pipelines. We get a pretty broad range of configs launched but a wide level of devs at different skill levels. Always looking to tune and enhance. As stated in a number of my feature messages, this is by far the most capable compliance tool we have found for Terraform detection |
Beta Was this translation helpful? Give feedback.
-
@eerkunt First off... WOW, so much work done, really amazed at the progress on the tool. I could hardly keep up. Things look much more stable and far more intuitive. Glad to see some of the features you posted are similar to the thought process we are using to write ours. Is there any chance you can roadmap the the filtering we were looking for above? As stated, it represents an entirely new way to evaluate and filter resources and prevents flagging compliance issues on existing infrastructure that may result in unintended resource destruction. Please let us know how we can help, unit tests, examples, etc. Very excited to see where the tool is climbing to. |
Beta Was this translation helpful? Give feedback.
-
How do resolve the below error: |
Beta Was this translation helpful? Give feedback.
-
Is there a way I can test the terraform version that is installed/being used? Use case - Terraform version is set to "1.0.0" . If the version is accidentally changed and committed, I want to to have a test scenario that will check if the version is still "1.0.0" and not something else Example- Problem( potential ) - The "terraform_version" is not under the "root_module" but above it Is there a scenario statement that i can use to test it? |
Beta Was this translation helpful? Give feedback.
-
Terraform-complaince is unable to find aws_msk_cluster resources Code- Output- plan.out.json file - |
Beta Was this translation helpful? Give feedback.
-
👋 Welcome!
We are using Github Discussions in order to provide quick responses on some of the elements that you are curious about. This section can be used for anything really. Please note that we can convert some of the discussions into Issues.
Beta Was this translation helpful? Give feedback.
All reactions