While atlantis is great in great in pull request process and we are using atlantis for pushing all changes to aws. One core thing which we found missing is populating the resource's creation/metadata tags automatically, specially the author for those changes.
I was wondering if we can export some default TF_VARs in each atlantis workflow steps which can be used within tf modules too.
1 such variable is
TF_VAR_atlantis_author = pr author
Thinking out loud, since atlantis is kind of CI, I believe it has received all those data as part of webhook. When the webhook trigger a step, we should be able to translate webhook's payload to tf_vars.
Should have RTFM
@rverma-jm what's the answer for others that stumble upon this?
Its there at https://www.runatlantis.io/docs/custom-workflows.html#custom-run-command.
What I was looking is PULL_AUTHOR. You can easily export it as TF_VAR_pull_author by env.
Although I couldn't figure out how to tie this terraform variable to just update the tag of the resource which are updated. I think i need a trigger for every resource in terraform/modules. Anyways this question is out of scope for atlantis.
If anyone ended up here, having similar thought, and have a solution, please share :)
Most helpful comment
Its there at https://www.runatlantis.io/docs/custom-workflows.html#custom-run-command.
What I was looking is PULL_AUTHOR. You can easily export it as TF_VAR_pull_author by env.
Although I couldn't figure out how to tie this terraform variable to just update the tag of the resource which are updated. I think i need a trigger for every resource in terraform/modules. Anyways this question is out of scope for atlantis.
If anyone ended up here, having similar thought, and have a solution, please share :)