Skip to content

Add ISO and eusc partitions to policy ARN suffix - #10526

Open
fixedbydev wants to merge 1 commit into
aws:developfrom
fixedbydev:bugfix/policy-arn-suffix-iso-partitions
Open

Add ISO and eusc partitions to policy ARN suffix#10526
fixedbydev wants to merge 1 commit into
aws:developfrom
fixedbydev:bugfix/policy-arn-suffix-iso-partitions

Conversation

@fixedbydev

Copy link
Copy Markdown

get_policy_arn_suffix only handled the aws, aws-cn, and aws-us-gov partitions. In an ISO region like us-iso-east-1, or the newer eusc European Sovereign Cloud regions, it fell through to "aws", so the IAM policy ARNs built by emr create-default-roles, dlm create-default-role, and emr-containers update-role-trust-policy came out with the wrong partition (arn:aws:... instead of arn:aws-iso:...), which is invalid in those partitions.

This adds the missing partitions, matching botocore's own region-to-partition data (verified against botocore.session.Session().get_partition_for_region):

region prefix partition
us-iso aws-iso
us-isob aws-iso-b
eu-isoe aws-iso-e
us-isof aws-iso-f
eusc- aws-eusc

The us-isob and us-isof checks are ordered before the more general us-iso check, since us-isob-east-1 also starts with us-iso. Unknown regions still fall back to "aws" as before, so the change is additive.

I kept the existing hardcoded-prefix shape and signature rather than delegating to botocore's resolver, since that would need a session/config passed in and would raise on brand-new regions instead of the current safe "aws" fallback. Happy to switch to the resolver approach instead if you'd prefer.

Added test coverage for each new partition in TestGetPolicyARNSuffix.

Generated by AI tools, and reviewed by fixedbydev.

get_policy_arn_suffix only handled aws, aws-cn, and aws-us-gov, so ISO
regions (us-iso, us-isob, eu-isoe, us-isof) and the eusc European
Sovereign Cloud regions fell through to "aws". That produced invalid
IAM policy ARNs (arn:aws:... instead of arn:aws-iso:...) in
emr create-default-roles, dlm create-default-role, and emr-containers
update-role-trust-policy.

Add the missing partitions, matching botocore's region-to-partition
data, with us-isob/us-isof checked before the general us-iso prefix.
Unknown regions still fall back to "aws".
@fixedbydev
fixedbydev requested a review from a team as a code owner August 2, 2026 15:22
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.

1 participant