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

s3: Load aws env vars from local environment #22008

Merged
merged 3 commits into from
Feb 27, 2025

Conversation

chris-smith-zocdoc
Copy link
Contributor

Fixes #21168 #20624

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
Copy link
Contributor Author

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()
Copy link
Contributor Author

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()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@benjyw benjyw left a 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.

@benjyw benjyw merged commit 6217725 into pantsbuild:main Feb 27, 2025
24 checks passed
@chris-smith-zocdoc chris-smith-zocdoc deleted the cs_env_vars_for_aws branch February 27, 2025 00:13
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.

Forward additional host env vars to the pantsd process
2 participants