You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(credential-providers): collect credential providers in single package (#2672)
* feat(credential-providers): collect credential providers in public facing package
* feat(credential-providers): support temporary credentials provider
Equivalent to ChainableTemporaryCredentials class in v2 SDK. The provider
is not re-exported from standalone package or used in the credential-
provider-ini because the roleAssumers function interface in other
packages does not suite the usecase of this provider. In roleAssumer
interface, the master credential is required. It's not true for
fromTemporaryCredentials, where master credentials can be skipped,
in which case the default credential will be used.
* docs: remove inline import to improve docs
* docs(credentail-providers): wrap other providers and add README
* docs(credential-provider): mark other provider as internal
* docs(upgrading): update the upgrading guide
* docs: use clientConfig to override all creds providers client config
Co-authored-by: Trivikram Kamat <[email protected]>
Copy file name to clipboardExpand all lines: UPGRADING.md
+49-64
Original file line number
Diff line number
Diff line change
@@ -221,33 +221,25 @@ Default credential provider is how SDK resolve the AWS credential if you DO NOT
221
221
masterCredentials during instantiation, precluding the ability to refresh credentials which require intermediate, temporary credentials.
222
222
223
223
The original [`TemporaryCredentials`](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/TemporaryCredentials.html)
224
-
has been **deprecated** in favor of `ChainableTemporaryCredentials` in v2 and ``
224
+
has been **deprecated** in favor of `ChainableTemporaryCredentials` in v2.
225
225
226
-
-**v3**: Partially supported. You can retrieve the temporary credential from STS with the
227
-
[role assumer function based on `sts:AssumeRole`](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-sts/globals.html#getdefaultroleassumer). The difference to v2 is that `sts:getSessionToken` is not called
228
-
if no `RoleArn` is supplied. Please open a [feature request](https://github.com/aws/aws-sdk-js-v3/issues/new?assignees=&labels=feature-request&template=---feature-request.md&title=)
The [`@aws/credential-provider-cognito-identity` package](https://www.npmjs.com/package/@aws-sdk/credential-provider-cognito-identity)
262
-
provides two credential provider functions, one of which [`fromCognitoIdentity`](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/modules/_aws_sdk_credential_provider_cognito_identity.html#fromcognitoidentity-1)
The [`@aws/credential-providers` package](https://www.npmjs.com/package/@aws-sdk/credential-providers)
254
+
provides two credential provider functions, one of which [`fromCognitoIdentity`](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/modules/_aws_sdk_credential_providers.html)
263
255
takes an identity ID and calls `cognitoIdentity:GetCredentialsForIdentity`, while the other
-**v3**: [`fromInstanceMetadata`](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/modules/_aws_sdk_credential_provider_imds.html#frominstancemetadata-1): Creates a credential provider that will source credentials from the EC2 Instance Metadata Service.
@@ -345,11 +331,11 @@ URI specified by the `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI` or the `AWS_CONTAI
345
331
variable.
346
332
347
333
-**v2**: `ECSCredentials` or [`RemoteCredentials`](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/RemoteCredentials.html).
348
-
-**v3**: [`fromContainerMetadata`](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/modules/_aws_sdk_credential_provider_imds.html#fromcontainermetadata-1) creates a credential provider that will source credentials from the ECS Container Metadata Service.
roleAssumer:getDefaultRoleAssumer(), // Optional. Required if you specify role to assume
403
-
roleAssumerWithWebIdentity:getDefaultRoleAssumerWithWebIdentity(), // Optional. Required if you specify role to assume using `sts:AssumeRoleWithWebIdentity` API
386
+
clientConfig: { region }, // Optional
404
387
}),
405
388
});
406
389
```
@@ -413,17 +396,18 @@ Retrieves credentials using OIDC token from a file on disk. It's commonly used i
## AWS Credential Provider for Node.JS - Instance and Container Metadata
6
+
> An internal package
7
7
8
-
This module provides two `CredentialProvider` factory functions,
9
-
`fromContainerMetadata` and `fromInstanceMetadata`, that will create
10
-
`CredentialProvider` functions that read from the ECS container metadata service
11
-
and the EC2 instance metadata service, respectively.
8
+
## Usage
12
9
13
-
A `CredentialProvider` function created with `fromContainerMetadata` will return
14
-
a promise that will resolve with credentials for the IAM role associated with
15
-
containers in an Amazon ECS task. Please see [IAM Roles for Tasks](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html)
16
-
for more information on using IAM roles with Amazon ECS.
17
-
18
-
A `CredentialProvider` function created with `fromInstanceMetadata` will return
19
-
a promise that will resolve with credentials for the IAM role associated with
20
-
an EC2 instance.
21
-
Please see [IAM Roles for Amazon EC2](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html)
22
-
for more information on using IAM roles with Amazon EC2.
23
-
Both IMDSv1 (a request/response method) and IMDSv2 (a session-oriented method) are supported.
24
-
Please see [Configure the instance metadata service](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html) for more information.
25
-
26
-
## Supported configuration
27
-
28
-
You may customize how credentials are resolved by providing an options hash to
29
-
the `fromContainerMetadata` and `fromInstanceMetadata` factory functions. The
30
-
following options are supported:
31
-
32
-
-`timeout` - The connection timeout (in milliseconds) to apply to any remote
33
-
requests. If not specified, a default value of `1000` (one second) is used.
34
-
-`maxRetries` - The maximum number of times any HTTP connections should be
35
-
retried. If not specified, a default value of `0` will be used.
10
+
You probably shouldn't, at least directly. Please use [@aws-sdk/credential-providers](https://www.npmjs.com/package/@aws-sdk/credential-providers)
0 commit comments