https://pulumi.com logo
Title
r

rough-intern-34947

02/21/2022, 2:52 PM
The
aws.secretsmanager.getSecret()
works, but
aws.secretsmanager.getSecretVersion()
doesn’t for some reason, it throws the following error:
error: Error: Invoke of 'aws:secretsmanager/getSecretVersion:getSecretVersion' failed: Missing required argument: The argument "secret_id" is required, but no definition was found. ()
    at deserializeResponse (./node_modules/@pulumi/runtime/invoke.ts:227:15)
    at ./node_modules/@pulumi/runtime/invoke.ts:169:16
    at Generator.next (<anonymous>)
    at fulfilled (./node_modules/@pulumi/pulumi/runtime/invoke.js:18:58)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
There is no
secret_id
specified in the TypeScript defintions - only
secretId
which is used on the example page as well. This is the code:
const credentials = aws.secretsmanager.getSecretVersion({
  secretId: mySecret.id,
})
https://www.pulumi.com/registry/packages/aws/api-docs/secretsmanager/getsecretversion/ https://www.pulumi.com/registry/packages/aws/api-docs/secretsmanager/getsecret/
1
This is how you fetch it - by giving it the ARN, not the
id
-.-
aws.secretsmanager.getSecretVersion({
    secretId: postgresCredentials.arn,
  })
l

little-cartoon-10569

02/21/2022, 8:07 PM
Re:
secret_id
vs. `secretId`: they're the same thing, the docs are built from a single location but the properties are built per-language. In this case,
secret_id
is probably the name in the AWS SDK request payload. Or maybe it's the name in the Terraform implementation, and Pulumi have used the Terraform docs to start from?
Either way, read property names in error messages only vaguely; they can be approximate and slightly misleading like this.