Open aureq opened 10 months ago
As an alternative, would fn::select
supporting maps and object types meet the user's needs?
(This is a straw proposal, but I think this would be a lower lift than changing the expression syntax similar to how you've described.)
# all other keys identical to example
resources:
# Create an AWS resource (S3 Bucket)
my-bucket:
type: aws:s3:Bucket
properties:
tags:
project:
fn::select:
- ${selector}
- ${projectDescription}
fn::select
would be an option.. but how would it work for multi-level objects? eg.
variables:
projectDescription:
regionA:
projectA: "This is region A, project A"
projectB: "This is region A, project B"
regionB:
projectA: "This is region B, project A"
projectB: "This is region B, project B"
config:
regionSelector: "regionA"
projectSelector: "projectA"
projectDescription.${regionSelector}.${projectSelector}
would read fairly well and is obvious what is happening.
Why not ${projectDescription[selector]}
?
Why not
${projectDescription[selector]}
?
yep, that works too.
@Frassle changing the substitution parsing requires more significant changes, changing or adding a built-in is lower lift.
However I'm wondering if std
already has this?
It looks like fn::std:lookup
has the right shape.
Hello!
Issue details
Currently, pulumi YAML is unable to resolve nested variables such as this example. The important line here being
project: ${projectDescription.${selector}}
where the project description could be fetThe
pulumi pre --diff
showsI've also tried using
project: ${projectDescription}.${selector}
but this returns:Affected area/feature