This message was deleted.
# general
s
This message was deleted.
f
Hi @limited-solstice-34584, you should try:
Copy code
const storedPassword = pulumi.output(secretsToStore).apply(secret => (
  new aws.secretsmanager.SecretVersion("macsdb_password", {
    secretId: secret.id,
    secretString: JSON.stringify(secret),
  }, { dependsOn: db })
))
l
thank you @faint-motherboard-95438
f
tbh `Input`/`Output` are a (necessary) pain in the a** and not easy to know exactly where you have to
apply
them to avoid the error you got. I’m still struggling with this on a daily basis…
l
thats fussing at me about missing secretId
btw @faint-motherboard-95438
f
what’s the expected type of
secretId
and what’s the type of
secret
? Maybe you need to apply this one too
nvm just check the spec,
secret.id
is a
string
so you should be fine here. What’s the exact error ?
l
one sec
error: Running program '/Users/chrisnorris/Documents/GitHub/pulumi/macs' failed with an unhandled exception:
Error: Missing required property 'secretId'
at new SecretVersion (/Users/chrisnorris/Documents/GitHub/pulumi/macs/node_modules/@pulumi/secretsmanager/secretVersion.ts:123:23)
at /Users/chrisnorris/Documents/GitHub/pulumi/macs/index.js:40:5
at /Users/chrisnorris/Documents/GitHub/pulumi/macs/node_modules/@pulumi/pulumi/output.js:249:35
at Generator.next (<anonymous>)
at /Users/chrisnorris/Documents/GitHub/pulumi/macs/node_modules/@pulumi/pulumi/output.js:21:71
at new Promise (<anonymous>)
at __awaiter (/Users/chrisnorris/Documents/GitHub/pulumi/macs/node_modules/@pulumi/pulumi/output.js:17:12)
at applyHelperAsync (/Users/chrisnorris/Documents/GitHub/pulumi/macs/node_modules/@pulumi/pulumi/output.js:228:12)
at /Users/chrisnorris/Documents/GitHub/pulumi/macs/node_modules/@pulumi/pulumi/output.js:182:65
at processTicksAndRejections (internal/process/task_queues.js:97:5)
thats the error @faint-motherboard-95438
f
Oh ok, sorry about that, just noticed in my exampe I redefined the
secret
variable. Your IDE should have complained about that. This one should work:
Copy code
const secret = new aws.secretsmanager.Secret("macsdb_password", {});

const storedPassword = pulumi.output(secretsToStore).apply(secretString => (
  new aws.secretsmanager.SecretVersion("macsdb_password", {
    secretId: secret.id,
    secretString: JSON.stringify(secretString),
  }, { dependsOn: db })
))
l
ok
ill try
thanks @faint-motherboard-95438
you wouldnt know anything about lambdas would ya in pulumi?
f
Didn’t use it yet with Pulumi, but that’s kind of the same deal as with any other resources. The community here can help you if you have any issue with it.
l
cool because its putting all sorts of crap in my lambda when it generates it
f
@limited-solstice-34584 try another thread with your code and what you’re getting/expecting
l
okk