Closed Spareo closed 6 years ago
nevermind, I figured it out right after posting this. I need to reference the variables with ${VARIABLE_NAME}
instead of {{VARIABLE_NAME}}
like the documentation shows.
Ahh, the reason is that {{VARIABLE_NAME}}
refers to parameters - it basically replaces that with ${Ref VARIABLE_NAME}
which means you cna use it for things like the Region, etc, from the AWS Cloudformation meta parameters.
If you want to use actual stacker blueprint variables, you have the right of it - ${VARIABLE}
. I'll check out the docs and see if we can make it more clear in the future.
Yeah it’s a little sparse on examples for that stuff but I got it working. Thanks!
@phobologic Is there a way to verify that the replacement is working?
I am getting an error that a variable I am trying to replace parameterized data into is just being read as an empty string. I verified that I have a variable defined for this property and im passing it in from the config file.
When I look at the CF template that gets generated it still shows the variables as ${VARIABLE}
instead of the actual value, I wasn't sure if this was correct either.
Yeah so I looked at the userdata script that gets generated on the instance and it still shows the variables as ${VARIABLE}
as well. However, the parameterized ones that use the {{}}
syntax like {{AWS::REGION}}
were replaced with the correct values.
Got on slack channel and figured out my issue. I'm good again.
I have followed the documentation here https://stacker.readthedocs.io/en/latest/lookups.html#file-lookup to add file lookup to my config.yaml for sending a UserData script to my stack.
In the config.yml file I have the following under the variables section
UserData: ${file parameterized-b64:file://configure.ps1}
Inside the configure.ps1 script I am referencing several other variables that I pass into the stack as well using this notation:
{{VARIABLE_NAME}}
However, when I attempt to deploy the stack I get an error:
The resource dependencies are the variables I am attempting to resolve. I can't figure out what Im doing wrong. Any help would be appreciated.