Thread
#general
    a

    average-tiger-58107

    3 months ago
    I want to access environment variables from my config as follows:
    
    const config = new pulumi.Config("environment");
    
    const var1 = config.require("VAR_NAME");
    const var2 = config.require("ANOTHER_VAR_NAME");
    
    
    // This works
    
    config:
      environment:VAR_NAME: "my value"
      environment:ANOTHER_VAR_NAME: "another value"
    
    ----------------------
    // This does not work
    
    config:
      environment:
        VAR_NAME: "my value"
        ANOTHER_VAR_NAME: "another value"
    It feels redundant to list the
    environment:
    prefix on every line. Am I missing something obvious about YAML? Why doesn't this work?
    w

    witty-candle-66007

    3 months ago
    a

    average-tiger-58107

    3 months ago
    I'm trying to get away from structured config because I've found that it's a mess when dealing with data structures containing both secret and non-secret values
    w

    witty-candle-66007

    3 months ago
    Ah yeah, so if not using structured config, then the pattern is to prefix each config variable with the namespace.https://www.pulumi.com/docs/intro/concepts/config/#configuration-keys
    a

    average-tiger-58107

    3 months ago
    Do you have any experience dealing with structured config where some values are secret and some arent?
    w

    witty-candle-66007

    3 months ago
    Unfortunately, I have not dug into that use-case.