Hello All. Does anyone know if it is possible to n...
# yaml
r
Hello All. Does anyone know if it is possible to nest a pulumi variable inside a resource reference? Scenario - I want to use a stack config key value inside a
dependsOn
attribute
Copy code
stack config:
  stack-config-key: parent

-----------------------------------------

variables:
  stack-config-key:
    type: String

resources:
  parent-resource-logical-id:
    ...

  child-resource-logical-id:
    type: xxxxxxxxxxx
    properties:
      ...
    options:
      dependsOn:
        - ${${stack-config-key}-resource-logical-id}
Note: This is a simplified example and does not demonstrate the actual use case.
a
Pulumi YAML currently requires that
dependsOn
is a static list of resources. You can’t choose them dynamically with variable substitution.
Copy code
pulumi:pulumi:Stack (dev-yaml-dev):
    error: expected resource, got string
    
      on Pulumi.yaml line 16:
      16:         - ${foo}
    error: Error registering resource [my-bucket]: no diagnostics