mirror of
https://github.com/awslabs/iam-policy-autopilot.git
synced 2026-04-25 16:05:58 +03:00
[PR #103] [MERGED] fix: support eu sovereign cloud #235
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/iam-policy-autopilot#235
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/awslabs/iam-policy-autopilot/pull/103
Author: @C85297
Created: 1/14/2026
Status: ✅ Merged
Merged: 2/4/2026
Merged by: @mschlaipfer
Base:
main← Head:policy-gen-support-eusc-partition📝 Commits (5)
43abbb7fix: support eu sovereign cloude844436Merge branch 'main' into policy-gen-support-eusc-partitione2659ebCHANGELOG306fda4Merge branch 'main' into policy-gen-support-eusc-partitione89055cMerge branch 'main' into policy-gen-support-eusc-partition📊 Changes
7 files changed (+302 additions, -30 deletions)
View changed files
📝
CHANGELOG.md(+4 -0)📝
iam-policy-autopilot-cli/src/main.rs(+1 -1)📝
iam-policy-autopilot-cli/tests/integration_tests.rs(+133 -0)📝
iam-policy-autopilot-mcp-server/src/tools/generate_policy.rs(+1 -1)📝
iam-policy-autopilot-policy-generation/build.rs(+57 -0)📝
iam-policy-autopilot-policy-generation/src/api/model.rs(+53 -28)📝
iam-policy-autopilot-policy-generation/src/embedded_data.rs(+53 -0)📄 Description
Currently,
AwsContextuses some heuristics to guess the corresponding partition for a given region. This is not ideal as it requires manual fixes when new partitions are created by AWS. The new EU Sovereign Cloud partition is not recognised by the heuristics.I updated
AwsContextto pull in botocore'spartitions.jsonfile. This file provides a region regex for each partition, which we can use to check if a region is in a given partition. This ensures we can automatically support new partitions without any work as soon as they are added to botocore.Note: the existing code would assume unknown regions are in the
awspartition. I would suggest this is not sensible behaviour - if we have theawspartition's region regex and know it doesn't match, then it is more likely that the region is either invalid or in a partition we are not aware of yet. In both those cases, I would say it would be a better idea to exit with an error, which I've implemented.The code does not cache the parsed partitions data, so multiple invocations of
AwsContext::newwill be unnecessarily expensive. SinceAwsContext::newis only invoked once during the CLI's execution, and no more than once during an MCP call, I decided to keep the code simple. I can change this if you'd prefer.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.