While using terraspace with it’s awesome templating feature I have a question regarding the syntax of the expansion method vs the aws_secret helper:
<%= expansion('csdap-cumulus-:ENV-:INSTANCE-tfstate') %>
vs
<%= aws_secret("csdap-cumulus-#{Terraspace.env}-#{@mod.options.instance}-urs-client-id") %>
Is there some place on the documentation where the available attributes of the Terraspace object on the aws_secret helper are shown? Would this be the correct way to reference the instance name?
Thank you!
tung
December 30, 2021, 8:04pm
2
Haven’t tested it. But here’s one way to currently do it:
<%= aws_secret(expansion('csdap-cumulus-:ENV-:INSTANCE-tfstate')) %>
Yup. The expansion results are essentially the same way you’ve accomplished it.
Thinking about it more, would like for the aws_secret
to call the expansion helper internally. For example, this would then work:
<%= aws_secret('csdap-cumulus-:ENV-:INSTANCE-tfstate') %>
Hope to get to it. Will consider PRs. No sweat either way of course.
tung
January 4, 2022, 1:55am
3
Update:
As of terraspace_plugin_aws 0.3.6 the expansion
method is automatically ran internally. So this should work:
<%= aws_secret('csdap-cumulus-:ENV-:INSTANCE-tfstate') %>
Did it for all cloud provider plugins: AWS, Azure, Google.
Related PRs:
Update docs also: https://terraspace.cloud/docs/helpers/aws/secrets/