-
-
Notifications
You must be signed in to change notification settings - Fork 652
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
s3: Load aws env vars from local environment #22008
Conversation
set_aws_env_vars(rule_runner, {"AWS_PROFILE": "profile1"}) | ||
creds4 = rule_runner.request(AWSCredentials, []) | ||
# N.B. Not totally sure why, but 'is' doesn't work here because of how set_options operates | ||
assert creds1 == creds4 |
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.
I'm not totally happy with these tests as I couldn't get the assertions working that the exact same object is returned, but in local testing with pantsd it appears to work correctly
@@ -48,7 +53,44 @@ async def access_aws_credentials() -> AWSCredentials: | |||
) | |||
raise | |||
|
|||
session = session.get_session() |
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.
was previously shadowing the import so I updated the import to an alias to avoid confusion
}, | ||
) | ||
|
||
session = boto_session.Session() |
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.
botocore session reference https://github.com/boto/botocore/blob/develop/botocore/session.py
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.
Nice! Thanks for this.
Fixes #21168 #20624