aws-sdk-js-v3
aws-sdk-js-v3 copied to clipboard
[credential-providers]: add fromStatic credential provider
Describe the feature
Add fromStatic credential provider which returns the static credentials passed to it.
Use Case
There's a static credential provider in v2, called AWS.Credentials.
An equivalent in v3 does not exist.
The v3 does have a static token provider though.
Proposed Solution
Add static credential provider, say fromStatic
in @aws-sdk/credential-providers
Example usage:
import { fromStatic } from "@aws-sdk/credential-providers";
const creds = fromStatic({
accessKeyId: 'akid',
secretAccessKey: 'secret',
sessionToken: 'session',
})
Other Information
Example use in production https://github.com/ToolJet/ToolJet/blob/bea8d1bd25075503e0873ddc74a0b271be1ce071/plugins/packages/amazonses/lib/index.ts#L80-L87
Acknowledgements
- [ ] I may be able to implement this feature request
- [ ] This feature might incur a breaking change
SDK version used
main
Environment details (OS name and version, etc.)
N/A