how can I export the `manageMasterUserPassword` va...
# aws
s
how can I export the
manageMasterUserPassword
value either a pulumi id or arn?
Copy code
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const test = new aws.rds.Cluster("test", {
    clusterIdentifier: "example",
    databaseName: "test",
    manageMasterUserPassword: true,
    masterUsername: "test",
});
g
I've not tested this program yet, but I believe you can use the following two lookup calls to retrieve the AWS created value
Copy code
import * as aws from "@pulumi/aws";

const test = new aws.rds.Cluster("test", {
    engine: "aurora-mysql",
    clusterIdentifier: "example",
    databaseName: "test",
    manageMasterUserPassword: true,
    masterUsername: "admin",
    skipFinalSnapshot: true,
});

// NOTE: this example assumes the masterUserSecrets array will ALWAYS have a single instance in it.
// lookup our the created secret and its current version, then export the needed value(s).
const secret = aws.secretsmanager.getSecretOutput({
    arn: test.masterUserSecrets.apply(masterUserSecrets => masterUserSecrets[0].secretArn),
});

const secretVersion = aws.secretsmanager.getSecretVersionOutput({
    secretId: secret.id,
});

export const password = secretVersion.secretString;