Expose component, stack, and tf workspace as tags and `TF_VAR` env vars
- Dominant language
- Go
- Stars
- 1.4k
- Forks
- 175
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 134
Description
Have a question? Please checkout our [Slack Community](https://slack.cloudposse.com) or visit our [Slack Archive](https://archive.sweetops.com/).
[](https://slack.cloudposse.com)
## 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
```sh
TF_VAR_atmos_base_component
TF_VAR_atmos_component
TF_VAR_atmos_stack
TF_VAR_atmos_terraform_workspace
```
## Expected Behavior
For a base component of `eks/cluster` (`type: abstract`) and a component `eks-blue/cluster` (`type: real`) planned against `uw2-dev` should return the following values
```sh
TF_VAR_atmos_base_component=eks/cluster
TF_VAR_atmos_component=eks-blue/cluster
TF_VAR_atmos_stack=uw2-dev
TF_VAR_atmos_terraform_workspace=uw2-dev-eks-blue-cluster
```
For a component of `ecr` (`type: real`) without metadata using `type: abstract` and planned against `uw2-dev` should return the following values (or similar)
```sh
TF_VAR_atmos_base_component=ecr
TF_VAR_atmos_component=ecr
TF_VAR_atmos_stack=uw2-dev
TF_VAR_atmos_terraform_workspace=uw2-dev-ecr
```
It would be nice to append the tags input with the above as well
```yaml
tags:
ATMOS_BASE_COMPONENT: ecr
ATMOS_COMPONENT: ecr
ATMOS_STACK: uw2-dev
ATMOS_TERRAFORM_WORKSPACE: uw2-dev-ecr
```
## Use Case
I'd like to
- add the above information as tags
- create unique ssm parameters using the path `/atmos_stack/atmos_component/key`
## Describe Ideal Solution
using `TF_VAR` env vars
## Alternatives Considered
N/A
## Additional Context
N/A
Contributor guide
Assessment
This issue has not been assessed yet.