diff --git a/blueprints/python/api-gateway-authorizer-python.py b/blueprints/python/api-gateway-authorizer-python.py index 1d79c32..1df870b 100644 --- a/blueprints/python/api-gateway-authorizer-python.py +++ b/blueprints/python/api-gateway-authorizer-python.py @@ -133,7 +133,17 @@ def _addMethod(self, effect, verb, resource, conditions): if resource[:1] == "/": resource = resource[1:] - resourceArn = ("arn:aws:execute-api:" + + """Added check for cn region in ARN and build the resourceARN accordingly.""" + if re.search("cn", self.region): + resourceArn = ("arn:aws-cn:execute-api:" + + self.region + ":" + + self.awsAccountId + ":" + + self.restApiId + "/" + + self.stage + "/" + + verb + "/" + + resource) + else: + resourceArn = ("arn:aws:execute-api:" + self.region + ":" + self.awsAccountId + ":" + self.restApiId + "/" +