Atlantis: Add support. for passing pr author's email to some TF_VAR

Created on 31 Mar 2020  路  3Comments  路  Source: runatlantis/atlantis

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.

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 :)

All 3 comments

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 :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

natalysheinin picture natalysheinin  路  3Comments

ldormoy picture ldormoy  路  6Comments

ojacobson picture ojacobson  路  5Comments

majormoses picture majormoses  路  3Comments

younus2019 picture younus2019  路  4Comments