Thread
#getting-started
    s

    shy-dentist-79386

    1 month ago
    b

    billowy-army-68599

    1 month ago
    there are examples in that doc
    what are you struggling with>
    m

    miniature-musician-31262

    1 month ago
    Hi there! The generated password is available on the
    result
    property: https://www.pulumi.com/registry/packages/random/api-docs/randompassword/#result_nodejs
    It’s wrapped in a
    pulumi.Output<string>
    , though, so depending on what you’re trying to do with the value, you might need to use the
    apply()
    method to get at it — for example:
    const password = new random.RandomPassword("password", {
        length: 16,
        special: true,
        overrideSpecial: `_%@`,
    });
    
    password.result.apply(unwrapped => console.log({ unwrapped }));
    if you’re trying to use the value as an input for another resource, though, you should be able to pass
    password.result
    to that resource, as in the example on that page (to @billowy-army-68599’s point):
    const example = new aws.rds.Instance("example", {
        instanceClass: "db.t3.micro",
        allocatedStorage: 64,
        engine: "mysql",
        username: "someone",
        password: password.result,
    });
    Does that help? More info on
    pulumi.Input
    and
    pulumi.Output
    is available in the docs: https://www.pulumi.com/docs/intro/concepts/inputs-outputs/
    s

    shy-dentist-79386

    1 month ago
    Ty!! I set up password for DB
    now I want to get the password so I can manually connect DB
    m

    miniature-musician-31262

    1 month ago
    Ah, ok yeah. So if your DB is accessible,
    apply
    should get you the raw string.
    s

    shy-dentist-79386

    1 month ago
    Is there a way to retrieve it without touching the pulumi code?
    ok, I see so I need to change pulumi code and using apply
    Ty!
    m

    miniature-musician-31262

    1 month ago
    Yeah. In this case because it’s a
    RandomPassword
    resource, the value is stored encrypted as well, so you’ll pretty much need to run Pulumi to get at it.
    s

    shy-dentist-79386

    1 month ago
    can I put this into output?? and use pulumi stack output --show-secrets to get it??
    m

    miniature-musician-31262

    1 month ago
    Indeed, that’ll work too!
    s

    shy-dentist-79386

    1 month ago
    Ty Ty!! That’s helpful!