Skip to content

chore: add partition to acktest identity functions #708

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/acktest/aws/identity.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ def get_account_id() -> int:

def get_region(default: str = "us-west-2") -> str:
return boto3.session.Session().region_name or default

def get_partition() -> str:
return boto3.client('sts').get_caller_identity().get('Arn').split(':')[1]
Comment on lines +26 to +27
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

I did see that..it just requires us to have a new dependency in requirements.txt just to get partition from an arn.
I am willing to add it if you think its best

Copy link
Member

Choose a reason for hiding this comment

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

I thought we already have a botocore dependency ( I think boto3 already depends on botocore)