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

fix(cli): AssumeRole profiles require a [default] profile #10032

Merged
merged 2 commits into from
Aug 28, 2020

Conversation

rix0rrr
Copy link
Contributor

@rix0rrr rix0rrr commented Aug 28, 2020

This works around a bug in the AWS SDK for JS that only surfaced when
we switched to AWS_STS_REGIONAL_ENDPOINTS=regional, requiring a
[default] profile with a region for all users.

The bug was that the INI-file AssumeRole provider would ignore the
region in the profile, and always fall back to the region in:

  • The profile specified using $AWS_PROFILE (which we don't use).
  • Otherwise the region in the [default] profile (which a user
    may or may not have).

Traditionally it didn't really matter whether the STS client got a
region or not because it would always connect to us-east-1 no matter
what, but when we switched to AWS_STS_REGIONAL_ENDPOINTS=regional, it
became illegal to not have a region.

Fix the upstream bug by basically replicating the important parts of
SharedIniFileCredentials of the AWS SDK in our codebase and patching
the bug.

Reported upstreeam as aws/aws-sdk-js#3418

Fixes #9937


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

This works around a bug in the AWS SDK for JS that only surfaced when
we switched to `AWS_STS_REGIONAL_ENDPOINTS=regional`, requiring a
`[default]` profile with a region for all users.

The bug was that the INI-file AssumeRole provider would ignore the
region in the profile, and always fall back to the region in:

* The profile specified using `$AWS_PROFILE` (which we don't use).
* Otherwise the region in the `[default]` profile (which a user
  may or may not have).

Traditionally it didn't really matter whether the STS client got a
region or not because it would always connect to `us-east-1` no matter
what, but when we switched to `AWS_STS_REGIONAL_ENDPOINTS=regional`, it
became illegal to not have a region.

Fix the upstream bug by basically replicating the important parts of
`SharedIniFileCredentials` of the AWS SDK in our codebase and patching
the bug.

Reported upstreeam as aws/aws-sdk-js#3418
@rix0rrr rix0rrr requested a review from a team August 28, 2020 09:05
@rix0rrr rix0rrr self-assigned this Aug 28, 2020
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Aug 28, 2020
@mergify
Copy link
Contributor

mergify bot commented Aug 28, 2020

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 95cbda4
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify
Copy link
Contributor

mergify bot commented Aug 28, 2020

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 95c0332 into master Aug 28, 2020
@mergify mergify bot deleted the huijbers/cli-default-profile branch August 28, 2020 11:18
@kyler-hyuna
Copy link

@rix0rrr is this live? If so which version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[core] v1.60.0 no longer accepts --profile flag
4 participants