pulumi / pulumi-yaml

YAML language provider for Pulumi
Apache License 2.0
39 stars 12 forks source link

Allow protect to be set dynamically #525

Open jamest-pin opened 10 months ago

jamest-pin commented 10 months ago

Hello!

Issue details

I want to set protect: dynamically. Something like this.

# Pulumi.develop.yaml
config:
  varProtectDBs: false

# Pulumi.production.yaml
config:
  varProtectDbs: true

# Pulumi.yaml
resources:
  myDBresource:
    options:
      protect: ${pulumi.stack}.${varProtectDBs}
    [...]

Why? In dev environment, I don't care if some resources get destroyed or recreated. In other environments that may have data populated, such as UAT or Prod, I want to set them protected. Best practice is to set per environment values in the stack config file. I'm currently unable to do this because protect: appears to only accept a literal boolean, not an interpolated value. See my comment and the following @Frassle 's comment in #453

Affected area/feature