Skip to content

Commit c190059

Browse files
Add comment explaining AWS credential provider chain
Adds a comment explaining how AWS SDK resolves credentials using the default credential provider chain (environment variables, shared credentials files, and IAM roles). This may help developers who are unfamiliar with how credentials are automatically discovered by the SDK.
1 parent 107448e commit c190059

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

javascriptv3/example_code/ses/src/libs/sesClient.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ sesClient.js is a helper function that creates an Amazon Simple Email Services (
1414
import { SESClient } from "@aws-sdk/client-ses";
1515
// Set the AWS Region.
1616
const REGION = "us-east-1";
17+
// Credentials are automatically resolved using the AWS SDK credential provider chain.
18+
// This includes:
19+
// - Environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
20+
// - Shared credentials file (~/.aws/credentials)
21+
// - IAM roles attached to compute services such as Amazon EC2, ECS, or AWS Lambda.
22+
// See: https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/setting-credentials-node.html
1723
// Create SES service object.
1824
const sesClient = new SESClient({ region: REGION });
1925
export { sesClient };

0 commit comments

Comments
 (0)