You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: APIGatewayAuthorizerResponse.from_route_arn drops the ARN partition (aws-cn, aws-us-gov) #8946
APIGatewayAuthorizerResponse.from_route_arn should build the policy with the same ARN partition as the methodArn it was given. For arn:aws-cn:execute-api:... the policy resource should start with arn:aws-cn:.
Current Behaviour
The partition is dropped and the policy always uses arn:aws:. For an authorizer in aws-cn or aws-us-gov the returned policy names a resource in a different partition from the method that was invoked. APIGatewayAuthorizerResponseWebSocket.from_route_arn does the same.
parse_api_gateway_arn already returns partition, and the constructor already accepts partition=. Both from_route_arn factories just don't pass it, so it falls back to the default "aws". Passing partition=parsed_arn.partition in both fixes it. I have this with tests and will open a PR.
Steps to Reproduce
Run the snippet above with 3.41.0 or develop (0bbc252).
I ran the snippet and saw the wrong ARN. I don't have an aws-cn or GovCloud account, so I haven't seen the resulting deny from a live API Gateway there; that part follows from the policy resource not matching the invoked method's ARN.
Thanks for opening your first issue here! We'll come back to you as soon as we can.
In the meantime, check out the #python channel on our Powertools for AWS Lambda Discord: Invite link
powertools-for-aws-oss-automation commented on Dec 2, 2026
Thanks for opening your first issue here! We'll come back to you as soon as we can.
In the meantime, check out our GitHub Discussions: Join the conversation
Activity
boring-cyborg commentedon Dec 2, 2026
Thanks for opening your first issue here! We'll come back to you as soon as we can.
In the meantime, check out the #python channel on our Powertools for AWS Lambda Discord: Invite link
powertools-for-aws-oss-automation commentedon Dec 2, 2026
Thanks for opening your first issue here! We'll come back to you as soon as we can.
In the meantime, check out our GitHub Discussions: Join the conversation