Open nitrocode opened 2 years ago
cc @aknysh @osterman @Gowiem thoughts?
@nitrocode I'm all for it -- I think this would be useful information in AWS resource tags as well to help pinpoint where resources are coming from for new team members who may be unaware. Considering that... any plans to pull these values into context.tf
to support tagging all resources with this information? We could accomplish that easily through an updated introspection.mixin.tf
.
Regardless, 👍
I believe we already expose these as general variables. What about using an existing provider:
https://registry.terraform.io/providers/tchupp/env/latest/docs/data-sources/variable https://registry.terraform.io/providers/shekhar-jha/env/latest/docs/data-sources/env_os
There's a dozen or more of these env var terraform providers.
Alternatively, I'd be open to supporting the template substitutions we support else where (e.g. stack_name_pattern
) so you can define your own ENV vars or tags. But building in this opinionated null-label/context conventions into atmos
IMO is breaking boundaries. Atmos should be a general purpose tool, not one designed specifically for cloud posse modules.
I suppose an existing provider would work. It would be easy enough to add the provider to a mixin and then add the mixin to each component. The down side of that would be that every component would rely on a custom 3rd party provider
Building your own ENV vars would be cool. I believe Atlantis has support for this e.g.
https://www.runatlantis.io/docs/custom-workflows.html#step
workflows:
default:
plan:
steps:
- env:
name: TF_VAR_terraform_repository
command: 'echo "github.com/${HEAD_REPO_OWNER}/${HEAD_REPO_NAME}"'
- env:
name: TF_VAR_terraform_repository_dir
command: 'echo "${REPO_REL_DIR}"'
- env:
name: TF_VAR_terraform_version
command: 'echo "${ATLANTIS_TERRAFORM_VERSION}"'
Maybe an implementation like this would be more flexible?
Have a question? Please checkout our Slack Community or visit our Slack Archive.
Describe the Feature
Expose component, stack, and tf workspace as TF_VAR env vars
I'd like to add TF_VAR inputs to receive the following env vars
Expected Behavior
For a base component of
eks/cluster
(type: abstract
) and a componenteks-blue/cluster
(type: real
) planned againstuw2-dev
should return the following valuesFor a component of
ecr
(type: real
) without metadata usingtype: abstract
and planned againstuw2-dev
should return the following values (or similar)It would be nice to append the tags input with the above as well
Use Case
I'd like to
/atmos_stack/atmos_component/key
Describe Ideal Solution
using
TF_VAR
env varsAlternatives Considered
N/A
Additional Context
N/A