-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support static stability in instance metadata credential provider (#4049
) * support static stability in EC2 credential provider * update test files eslintrc version * add changelog * update the error message
- Loading branch information
1 parent
6d7d96c
commit 9917399
Showing
6 changed files
with
267 additions
and
68 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
.changes/next-release/feature-EC2MetadataCredentials-f20878a4.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"type": "feature", | ||
"category": "EC2MetadataCredentials", | ||
"description": "Allow EC2MetadataCredentials to extend the existing expiration when EC2 Metadata Service returns expired credentials or failure response." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,31 @@ | ||
import {Credentials} from '../credentials'; | ||
import {Logger} from '../config-base'; | ||
|
||
export class EC2MetadataCredentials extends Credentials { | ||
/** | ||
* Creates credentials from the metadata service on an EC2 instance. | ||
* @param {object} options - Override the default (1s) timeout period. | ||
*/ | ||
constructor(options?: EC2MetadataCredentialsOptions); | ||
} | ||
interface EC2MetadataCredentialsOptions { | ||
httpOptions?: { | ||
/** | ||
* Timeout in milliseconds. | ||
*/ | ||
timeout?: number | ||
/** | ||
* Connection timeout in milliseconds. | ||
*/ | ||
connectTimeout?: number | ||
} | ||
maxRetries?: number | ||
/** | ||
* Creates credentials from the metadata service on an EC2 instance. | ||
* @param {object} options - Override the default (1s) timeout period. | ||
*/ | ||
constructor(options?: EC2MetadataCredentialsOptions); | ||
|
||
/** | ||
* The original expiration of the current credential. In case of AWS | ||
* outage, the EC2 metadata will extend expiration of the existing | ||
* credential. | ||
*/ | ||
originalExpiration?: Date; | ||
} | ||
interface EC2MetadataCredentialsOptions { | ||
httpOptions?: { | ||
/** | ||
* Timeout in milliseconds. | ||
*/ | ||
timeout?: number | ||
/** | ||
* Connection timeout in milliseconds. | ||
*/ | ||
connectTimeout?: number | ||
} | ||
maxRetries?: number | ||
logger?: Logger | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"extends": "../.eslintrc", | ||
"parserOptions": { | ||
"ecmaVersion": 8 | ||
"ecmaVersion": 9 | ||
} | ||
} |
Oops, something went wrong.