File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -69,7 +69,32 @@ export interface AuthMechanismProperties extends Document {
6969 ALLOWED_HOSTS ?: string [ ] ;
7070 /** The resource token for OIDC auth in Azure and GCP. */
7171 TOKEN_RESOURCE ?: string ;
72- /** A custom AWS credential provider to use. */
72+ /**
73+ * A custom AWS credential provider to use. An example using the AWS SDK default provider chain:
74+ *
75+ * ```ts
76+ * const client = new MongoClient(process.env.MONGODB_URI, {
77+ * authMechanismProperties: {
78+ * AWS_CREDENTIAL_PROVIDER: fromNodeProviderChain()
79+ * }
80+ * });
81+ * ```
82+ *
83+ * Using a custom function that returns AWS credentials:
84+ *
85+ * ```ts
86+ * const client = new MongoClient(process.env.MONGODB_URI, {
87+ * authMechanismProperties: {
88+ * AWS_CREDENTIAL_PROVIDER: async () => {
89+ * return {
90+ * accessKeyId: process.env.ACCESS_KEY_ID,
91+ * secretAccessKey: process.env.SECRET_ACCESS_KEY
92+ * }
93+ * }
94+ * }
95+ * });
96+ * ```
97+ */
7398 AWS_CREDENTIAL_PROVIDER ?: AWSCredentialProvider ;
7499}
75100
You can’t perform that action at this time.
0 commit comments