stale-vase-87890
01/26/2022, 9:00 PMinterface appsecrets {
auth0clientid: string,
}
const appsecrets = config.requireSecretObject<appsecrets>("appsecrets")
const auth0client = appsecrets.auth0clientid
const example1 = {
auth0clientid1: auth0client
}
const exampleSecretVersion = new aws.secretsmanager.SecretVersion("exampleSecretVersion", {
secretId: example.id,
secretString: JSON.stringify(example1)
})
I have tried all sorts of things like appsecrets.auth0clientid.apply(v => JSON.stringify(v))
but it still is going to be a type of Output<T> and it sets the value in secrets manager as
Calling [toJSON] on an [Output<T>] is not supported. To get the value of an Output as a JSON value or JSON string consider either: 1: o.apply(v => v.toJSON()) 2: o.apply(v => JSON.stringify(v)) See https://pulumi.io/help/outputs for more details. This function may throw in a future version of @pulumi/pulumi.bored-table-20691
01/26/2022, 9:04 PMapply
.
It would look something like:
appsecrets.auth0clientid.apply(v => JSON.stringify({auth0clientid1: v}))
secrestString
.stale-vase-87890
01/26/2022, 9:07 PMbored-table-20691
01/26/2022, 9:09 PMstale-vase-87890
01/26/2022, 9:12 PMbored-table-20691
01/26/2022, 9:14 PMstale-vase-87890
01/26/2022, 9:15 PMconst auth0client = pulumi.all([appsecrets.auth0clientid, appsecrets.auth0]).apply(([clientid, auth]) => JSON.stringify({auth0clientid1: clientid, authclient:auth}))
It is ugly but it works now to add helpful comments so I remember what this does a week from now πbored-table-20691
01/26/2022, 9:24 PMechoing-dinner-19531
01/26/2022, 10:51 PMoutput({auth0lientid1: appsecrets.auth0clientid, authclient:appsecrets.auth0}).apply(JSON.stringify)