Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Configure Services' Endpoint URLs via Environment Variables #1239

Closed
bradynpoulsen opened this issue Apr 5, 2017 · 15 comments
Closed
Labels
feature-request A feature should be added or improved. no-autoclose This issue should not be auto-closed by stale-issue-cleanup action. p2 This is a standard priority issue

Comments

@bradynpoulsen
Copy link
Contributor

I've been looking the documentation about environment variables and see that you are able to configure credentials, regions, and profiles using environment variables, but I do not see a way to configure the endpoint url option to point to our internal proxy.

My suggestion is to configure the endpoint url if either the AWS_<REGION>_<SERVICE>_ENDPOINT or AWS_<SERVICE>_ENDPOINT (in that order of priority) environment variables are available.

I suggest making this change in one of these locations (that I have found so far) in order of suggestion preference:

For reference purposes:

@bradynpoulsen
Copy link
Contributor Author

As a heads up, I am starting a PR to provide an implementation of this

@imshashank imshashank added enhancement guidance Question that needs advice or information. and removed enhancement labels Apr 5, 2017
@imshashank
Copy link
Contributor

@bradynpoulsen You can provide the endpoint as part of the client.

Please have a look at the documentation here: https://docs.aws.amazon.com/aws-sdk-php/v3/guide/guide/configuration.html#endpoint

We would like to know more about your scenario and why would you prefer setting up endpoints as environment variable.

@imshashank imshashank added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Apr 5, 2017
@bradynpoulsen
Copy link
Contributor Author

bradynpoulsen commented Apr 5, 2017

We have 2 different use cases right now.

  1. Local Environment
    We inherit everything from the environment currently and are wanting to stub out the APIs. But it feels weird that we can currently configure everything through the environment but have to add some sort of if condition to add the 'endpoint' configuration only during non-production environments.

  2. Feature Deployments via Docker
    We are deploying our application in a disposable way for integration testing against feature/bug branches to verify issues are being resolved. Same thing as above that everything is currently configured through the environment (excluding the version), but they have to go through a proxy to pass through the outbound firewall.

Maybe it's just me, but it feel inconsistent to allow key things (credentials/environment) to easily be configured through environment variables, but then prevent something like the endpoint configuration from being allowed.

bradynpoulsen added a commit to bradynpoulsen/aws-sdk-php that referenced this issue Apr 5, 2017
@cjyclaire cjyclaire added discussion feature-request A feature should be added or improved. and removed guidance Question that needs advice or information. labels Apr 11, 2017
@imshashank
Copy link
Contributor

@bradynpoulsen Hi, thanks a lot for this suggestion and for opening the PR. This is a design change and would affect all existing customers. We are working out the standards and practices to follow before allowing endpoints to be configured via endpoints URL. Please give us some time before we implement the feature. Thanks a lot for your patience.

@imshashank imshashank added enhancement and removed response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. discussion feature-request A feature should be added or improved. labels Apr 12, 2017
@bradynpoulsen
Copy link
Contributor Author

@imshashank Sounds good to me. I think these environment variables could be useful with any of the SDKs, so if a standard can be established, that always sounds like the better direction.

@glebsts
Copy link

glebsts commented Oct 14, 2017

+1. We are using Atlassian LocalStack running in docker to test our app running in docker, and we can set i.e. access key and default region to same as in localstack through app container env vars, but we cannot change endpoint to point to localstack url in same manner. Seems weird.

@bvitale
Copy link

bvitale commented Nov 20, 2017

+1

@hexpunk
Copy link

hexpunk commented Apr 6, 2018

Any movement on this? It's been a while since we last heard about this.

@hholst80
Copy link

hholst80 commented Dec 21, 2018

I know this use-case isn't going to fly but... It would be much better to be able to NOT having to specify an alias or wrapper for aws and "just work". If I know the awscli is installed somewhere in the container the following would work and it would allow us to spawn a regular S3 enabled container and configure the S3 access through environment variables, only.

.env

AWS_SECRET_KEY_ID=foo
AWS_SECRET_ACCESS_KEY=bar
AWS_S3_ENDPOINT=endpoint.csp.com

docker-compose.yml

version: 3
services:
  foo:
    image: ubuntu:18.04
    environment:
      - AWS_SECRET_KEY_ID
      - AWS_SECRET_ACCESS_KEY
      - AWS_S3_ENDPOINT

@ajit0003
Copy link

Has this been implemented yet?

@hholst80
Copy link

hholst80 commented Dec 3, 2019

I implemented it here https://github.com/morecontainers/awscli as a patch on vanilla awscli. It should probably be implemented properly in boto but I have not found a problem yet with my work around.

@howardlopez howardlopez added the no-autoclose This issue should not be auto-closed by stale-issue-cleanup action. label Aug 27, 2020
@shadiramadan
Copy link

Whatever happened here? The PR was closed and then left to die. @kstich any ideas? I'm also using localstack and having to wrap all the client calls with custom code to only pass in an endpoint url via a custom defined env var. It's weird this isn't a default.

@kellertk
Copy link
Contributor

Thank you for posting your feedback here, and our apologies that we’ve been thinking this over for a long time without much forward motion. There are similar requests to implement this feature in a few of the AWS SDKs and the AWS CLI, so in order to coordinate those teams - and hopefully make the discussions a little easier to follow - we’ve created a new issue in aws/aws-sdk here: aws/aws-sdk#229

@aws aws locked and limited conversation to collaborators Apr 26, 2022
@tim-finnigan
Copy link

Hi all,

We recently added a pull request (aws/aws-sdk#230) that contains a proposal based on community comments and suggestions and our own discussions. This document proposes to extend the options for configuring the endpoint to allow users to provide an endpoint URL independently for each AWS service via an environment variable or a profile subsection in the shared configuration file.

You can read the proposal here.

For more information on how to give feedback, please see this comment on the aws/aws-sdk repository:

aws/aws-sdk#229 (comment)

Thanks!

@yenfryherrerafeliz yenfryherrerafeliz added p3 This is a minor priority issue p2 This is a standard priority issue and removed p3 This is a minor priority issue labels Jan 2, 2023
@stobrien89
Copy link
Member

Hi all,

As mentioned, aws/aws-sdk#230 contains a proposal for this feature based on community comments and suggestions. Work on this is still ongoing, but I think we've reached a place where this feature request is no longer needed on the PHP SDK's repository— The AWS SDKs and Tools team as a whole has assumed responsibility for this feature. I think we'll be seeing some updates on this very soon.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request A feature should be added or improved. no-autoclose This issue should not be auto-closed by stale-issue-cleanup action. p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests