File tree 1 file changed +26
-1
lines changed
1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -69,7 +69,32 @@ export interface AuthMechanismProperties extends Document {
69
69
ALLOWED_HOSTS ?: string [ ] ;
70
70
/** The resource token for OIDC auth in Azure and GCP. */
71
71
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
+ */
73
98
AWS_CREDENTIAL_PROVIDER ?: AWSCredentialProvider ;
74
99
}
75
100
You can’t perform that action at this time.
0 commit comments