-
Notifications
You must be signed in to change notification settings - Fork 634
Description
Describe the feature
Allow specifying the endpoint with environment variables such as AWS_ENDPOINT (global), AWS_ENDPOINT_S3, etc.
Use Case
Configuring credentials via environment variables is handy for various environments, especially development. However, endpoints can’t be configured this way, so specific code must be written to support customizing endpoints.
Would be useful being able to define AWS_ENDPOINT=http://localhost:4566
in an .env.local
file, along with fake credentials, and have a working dev environment with LocalStack.
The AWS CLI can also be configured this way.
Also, some packages do instantiate clients directly (without ability to pass options), trusting users can leverage env vars to customize the clients.
Proposed Solution
Add a new endpointProvider
property to clients for custom endpoint retrieval. Default to fromEnv
with a fallback to the current behavior.
Ideally, the endpoint provider receives a service identifier to consume specific environment variables per client type (e.g., S3Client reads AWS_ENDPOINT_S3 first).
Other Information
No response
Acknowledgements
- I may be able to implement this feature request
- This feature might incur a breaking change
SDK version used
3
Environment details (OS name and version, etc.)
osx