-
Notifications
You must be signed in to change notification settings - Fork 30
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
Read region value for non default profiles #880
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #880 +/- ##
==========================================
+ Coverage 62.39% 62.78% +0.38%
==========================================
Files 279 282 +3
Lines 10908 10922 +14
Branches 1515 1517 +2
==========================================
+ Hits 6806 6857 +51
+ Misses 3565 3526 -39
- Partials 537 539 +2 ☔ View full report in Codecov by Sentry. |
2565a7a
to
f935b14
Compare
6d8583e
to
ae858c0
Compare
6c5fd2d
to
ad23dcb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR should target dev
not main
. Also, you should add a change file
to the PR https://github.com/awslabs/aws-dotnet-messaging/blob/main/CONTRIBUTING.md#adding-a-change-file-to-your-contribution-branch.
1154162
to
80a0d73
Compare
80a0d73
to
ed86700
Compare
Issue #, if available: N/A
Description of changes:
Why is this change being made?
The problem we are trying to solve is that the dotnet tool does not take into account the AWS region when a non default profile is being used. It will use the region set on the default profile (if available) instead.
Also, this change also updates the cdk bootstrap version
For example consider the following profile setups.
Scenario 1
Running the program with
AWS.Deploy.CLI.exe deploy --profile test
will result in region
us-east-1
being used rather thanus-west-2
As a workaround, we let the user know to provide the --region parameter when a non default profile is being used
AWS.Deploy.CLI.exe deploy --profile test --region us-west-2
Scenario 2: There is also another scenario that can occur with the following profiles setup (no default profile/default profile doesn't have a region)
When running with
AWS.Deploy.CLI.exe deploy --profile test
this will prompt the user to enter a region as input
Both of these scenarios are not ideal because we are requiring the user to manually select the region each time (either by providing --region flag as input or by doing as input in command line)
What is this change being made?
ResolveAWSCredentials
function to read the profile's region and return it from the function. This allows the next function (ResolveAWSRegion
to use the returned profile's region as input.AWSUtilities
so that some of the credential chain logic is injected so that unit tests can be written for this class.How is this change tested?
Scenario 1
Running the program with
AWS.Deploy.CLI.exe deploy --profile test
I validated that the program auto detected
us-west-2
rather thanus-east-
Scenario 2: There is also another scenario that can occur with the following profiles setup (no default profile/default profile doesn't have a region)
When running with
AWS.Deploy.CLI.exe deploy --profile test
I validated that i am not prompted anymore for a region, and
us-west-2
is auto detected.I also validated that the existing functionality of explicitly specifying a region still works. For example, even with this profile
i ran
AWS.Deploy.CLI.exe deploy --profile test --region us-west-1
and validatedus-west-1
was chosen.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.