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 role assumer region issue #324

Merged
merged 6 commits into from
Mar 27, 2020
Merged

Conversation

petervandoros
Copy link
Contributor

Context

There is an error when assuming a role without having configured a default AWS region in your environment:

Executing apply on my-stack in us-east-1
Aws::Errors::MissingRegionError: missing region; use :region option or export region name to ENV['AWS_REGION']

Changes

  • Use the CloudFormation driver's region, which includes fallbacks when it's not specified, when assuming a role

Considerations

Which region is used doesn't actually matter when assuming a role, as IAM and STS are global services.

There is an error when assuming a role and your environment doesn't have
a default aws region configured.
@orien
Copy link
Member

orien commented Mar 20, 2020

It seems the specs are suffering from a similar problem to that described in the PR description: when a default region is defined in ~/.aws/config the tests pass (a string value is passed to the Aws::AssumeRoleCredentials initialiser). But if no default region is defined, the tests fail (nil is passed to the Aws::AssumeRoleCredentials) as exhibited in CI.

Perhaps StackMaster.cloud_formation_driver should be stubbed.

Copy link
Member

@orien orien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@petervandoros petervandoros merged commit 11ba502 into master Mar 27, 2020
@orien orien deleted the fix-role-assumer-region-issue branch January 23, 2021 02:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants