terraform-cdk
terraform-cdk copied to clipboard
Specifying context values in the CDKTF CLI
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Description
This feature is about adding the CLI option --context
or -c
to pass runtime context values to your CDK app, like in the AWS CDK.
This feature can be helpful in providing runtime values to the CDK app using a CLI format, currently, the only way is using environment variables.
References
#347 has some additional thoughts on this topic.
One can use a workaround by passing your context values in as environment variables and read them from your CDKTF program. I think one can also put them in the cdktf.json's context section, right @jsteinich ?
One can use a workaround by passing your context values in as environment variables and read them from your CDKTF program. I think one can also put them in the cdktf.json's context section, right @jsteinich ?
Yes, if you add in the cdktf.json
you cannot change at runtime like you can in the AWS CDK by passing the --context var1=value1
.
Regarding the values as environment variables, I'm already doing that.
This is essential for maintaining multi-environment stacks, please integrate this functionality