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

Do not try to read ~/.aws/config when all configuration is provided #1947

Closed
ondrejmirtes opened this issue Jan 8, 2020 · 3 comments
Closed
Labels
feature-request A feature should be added or improved.

Comments

@ondrejmirtes
Copy link

Please fill out the sections below to help us address your issue.

Version of AWS SDK for PHP?

3.130.3

Version of PHP (php -v)?

PHP 7.3.6

What issue did you see?

AWS SDK for PHP tries to read ~/.aws/config dozens of times when using the S3 client. It's not necessary as the file does not exist and we provided all S3-related config keys to the client in the constructor.

Steps to reproduce

If you have a runnable example, please include it as a snippet or link to a repository/gist for larger code examples.

This is how the $args passed to Aws\S3\S3Client look like:

				http_handler: @amazonHttpClient # our Guzzle client
				region: eu-west-1
				version: latest
				credentials: [
					key: xxx
					secret: yyy
				]

I also learned that some of the read attempts go down when I additionally pass s3_us_east_1_regional_endpoint: legacy in there (even when we use a different region).

Additional context

Any additional information relevant to the issue. Examples include any framework you may be using (e.g. Laravel, Wordpress) in conjunction with the AWS SDK for PHP, or PHP/environment config settings if the issue is related to memory or performance.

This is causing us performance issues.

@ondrejmirtes
Copy link
Author

Similar issue: #1931

@diehlaws diehlaws self-assigned this Apr 21, 2020
@diehlaws diehlaws added the feature-request A feature should be added or improved. label Apr 21, 2020
@diehlaws
Copy link
Contributor

Hi @ondrejmirtes, thanks for reaching out about this and apologies for the long delay in response on our end. We have a task to investigate the implementation of a single configuration option that would prevent the SDK from reading the shared configuration file altogether. Once we have additional information on this we'll update the issue accordingly.

In the meantime, in addition to s3_us_east_1_regional_endpoint there are a few configuration options that the SDK looks for in the shared configuration file. Setting the following environment variables to the given values should prevent the SDK from attempting to parse the shared configuration file:

AWS_CSM_ENABLED=false
AWS_ENDPOINT_DISCOVERY_ENABLED=false
AWS_S3_USE_ARN_REGION=false
AWS_STS_REGIONAL_ENDPOINTS=legacy

@diehlaws diehlaws removed their assignment Aug 26, 2020
@howardlopez
Copy link
Contributor

We have added a configuration option to never read configuration from a file in this PR: #2047

This should hopefully address your use case, but let us know if you have any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved.
Projects
None yet
Development

No branches or pull requests

3 participants