@aws-sdk/credential-provider-node incorrect documentation
See original GitHub issueDescribe the issue with documentation
A clear and concise description of what the issue is.
const { getDefaultRoleAssumerWithWebIdentity } = require("@aws-sdk/client-sts");
const { defaultProvider } = require("@aws-sdk/credential-provider-node");
const { S3Client, GetObjectCommand } = require("@aws-sdk/client-s3");
const provider = defaultProvider({
roleAssumerWithWebIdentity: getDefaultRoleAssumerWithWebIdentity,
});
const client = new S3Client({ credentialDefaultProvider: provider });
Assigning provider
to credentialDefaultProvider like the documentation suggests results in errors.
Steps to reproduce
Please share code or minimal repo if required, and steps to reproduce the behavior.
import { DynamoDBClient, DynamoDBClientConfig } from '@aws-sdk/client-dynamodb';
import { defaultProvider } from '@aws-sdk/credential-provider-node';
const dynamoDBClientConfig: DynamoDBClientConfig = {
region: config.AWS_REGION,
credentialDefaultProvider: defaultProvider({
roleArn: config.ROLE_ARN,
durationSeconds: config.DURATION,
}),
};
Observed behavior
A clear and concise description of what happens.
Expected behavior
A clear and concise description of what you were expecting to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Module @aws-sdk/credential-provider-node
AWS Credential Provider for Node.JS. This module provides a factory function, fromEnv , that will attempt to source AWS credentials from a Node....
Read more >@aws-sdk/credential-providers | AWS SDK for JavaScript v3
This credential provider is intended for use with the AWS SDK for Node.js. Supported configuration. You may customize how credentials are resolved by...
Read more >Setting Credentials in Node.js - AWS ... - AWS Documentation
Credentials loaded from the ECS credentials provider (if applicable). Credentials that are obtained by using a credential process specified in the shared AWS...
Read more >Setting credentials in Node.js - AWS ... - AWS Documentation
Here's the order of the sources where the default credential provider resolve credentials from: Environment variables. The shared credentials file. Credentials ...
Read more >@aws-sdk/credential-provider-ini | AWS SDK for JavaScript v3
@aws-sdk/credential-provider-ini. NPM version NPM downloads. An internal package. Usage. You probably shouldn't, at least directly. Please use ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
➕ - Also seeing the same error. @samchungy - Thanks for the workaround soln.
Yeah good finds, I didn’t look into to it too much tbh @adworacz. Just wanted to highlight that the doco was wrong. I did also state:
In my case I was simply looking for how to use STS roles and
fromTemporaryCredentials
is the easiest way as it allows for chaining of roles too.