The `aws.secretsmanager.getSecret()` works, but `a...
# aws
r
The
aws.secretsmanager.getSecret()
works, but
aws.secretsmanager.getSecretVersion()
doesn’t for some reason, it throws the following error:
Copy code
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:
Copy 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
-.-
Copy code
aws.secretsmanager.getSecretVersion({
    secretId: postgresCredentials.arn,
  })
l
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.