-
Notifications
You must be signed in to change notification settings - Fork 65
Fix default profile handling when parsing AWS configuration files #727
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
Conversation
| if profile != "default" || !haskey(sections(ini), "default") | ||
| profile = "profile $profile" | ||
| # Prefer using "profile default" over "default" | ||
| section_name = if profile != "default" || haskey(sections(ini), "profile default") | ||
| "profile $profile" | ||
| else | ||
| "default" | ||
| end |
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.
Note the previous logic was to prefer default over profile default which deviates from the AWS CLI preference.
|
Made this feature opt-in as other logic in this code base expects only the one profile to be loaded. I discovered this in #726 and I thought it best to keep things simple for now and maybe we can use the recursive approach across the board in an future update. |
source_profilesource_profile
source_profilesource_profile
test/unit/AWSCredentials.jl
Outdated
| source_profile = test | ||
| role_arn = arn:aws:iam::123456789000:role/Dev | ||
| [profile test:sub-dev] |
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.
If this now supports chained roles, the max time for the session is one hour. Would this time limit cause any other issues?
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.
We supported role chaining before this change so nothing really changed here. Any issues that existed before would still be present
source_profile|
PR has been revised to no longer support inheritance as AWS configurations don't usually support that (annoyingly). |
While working on #726 it was noticed that one of ourAWSConfigtests was falling back to getting the region from IMDS when it should have been getting that information from the AWS configuration file viasource_profile. This PR updates the internal function_aws_profile_configto combine the various configuration sections with all of the options inherited viasource_profile.In #726 I noticed that some tests which appeared to be unit tests were failing as they would attempt to fallback on IMDS to determine the region. This made me investigate the internals of the
_aws_profile_configand address some minor issues.