-
Notifications
You must be signed in to change notification settings - Fork 8
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
Filter out gov regions by default. #59
Conversation
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.
LGTM
I would make it even simpler. No parameters. Always remove the GovCloud regions. return [
entry.get('id', '').split(':')[1]
for entry in response.json().get('prices')
if entry.get('id').startswith('controltower') and not "us-gov-" in entry.get('id')
] Each AWS account is scoped to one partition. Those features mean an AWS account created in the Similarly an AWS account created in the So So for now just make it work again in the Later if you want to make it work in either partition you could add a check for the current partition and then build a payload that contains just the regions that belong to that partition. You can check the current partition using STS.GetCallerIdentity. Session().client("sts").get_caller_identity()["Arn"].split(":")[1] That will return one of That's how we detect the partition in botocove. (See connelldave/botocove#63.) caller_id = self.sts_client.get_caller_identity()
self.host_account_id = caller_id["Account"]
self.host_account_partition = caller_id["Arn"].split(":")[1] |
I need to get better at using my personal account for personal stuff 😂 |
Assuming you agree with @iainelder @aperov9 I have made the change. If you guys are ok, i can release a patch version. |
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.
Looks good!
@costastf , let us know when you publish a new patch version so that we can use it downstream in superwerker :-) |
v3.1.4 is released. Thanks! |
No description provided.