Skip to content

Commit

Permalink
Merge pull request #236 from adanaja/morosi-fix2
Browse files Browse the repository at this point in the history
Fix InvokeFunction permission for ANY method
  • Loading branch information
adanaja authored Jan 12, 2024
2 parents 09835af + cc6365c commit 319d4fd
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/e3/aws/troposphere/apigateway/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,7 @@ def _declare_method(
f"${{api}}/{config.name}/${{method}}/{resource_path}",
dict_values={
"api": self.ref,
"method": method.method,
"method": "*" if method.method == "ANY" else method.method,
},
),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ def test_rest_api_nested_resources(stack: Stack, lambda_fun: PyFunction) -> None
# Specific lambda for this resource
lambda_arn=products_lambda.ref,
method_list=[Method("ANY")],
resource_list=[Resource(path="abcd", method_list=[Method("ANY")])],
resource_list=[Resource(path="abcd", method_list=[Method("GET")])],
),
],
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
"api": {
"Ref": "Testapi"
},
"method": "ANY"
"method": "*"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
"api": {
"Ref": "Testapi"
},
"method": "ANY"
"method": "*"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@
"api": {
"Ref": "Testapi"
},
"method": "ANY"
"method": "*"
}
]
}
Expand All @@ -226,7 +226,7 @@
"api": {
"Ref": "Testapi"
},
"method": "ANY"
"method": "*"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
"api": {
"Ref": "Testapi"
},
"method": "ANY"
"method": "*"
}
]
}
Expand All @@ -191,7 +191,7 @@
"api": {
"Ref": "Testapi"
},
"method": "ANY"
"method": "*"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"DependsOn": [
"TestapiAccountsANYMethod",
"TestapiProductsANYMethod",
"TestapiProductsAbcdANYMethod"
"TestapiProductsAbcdGETMethod"
]
},
"TestapiDefaultStage": {
Expand Down Expand Up @@ -178,13 +178,13 @@
},
"Type": "AWS::ApiGateway::Method"
},
"TestapiProductsAbcdANYMethod": {
"TestapiProductsAbcdGETMethod": {
"Properties": {
"RestApiId": {
"Ref": "Testapi"
},
"AuthorizationType": "NONE",
"HttpMethod": "ANY",
"HttpMethod": "GET",
"Integration": {
"CacheKeyParameters": [],
"CacheNamespace": "none",
Expand Down Expand Up @@ -222,7 +222,7 @@
"api": {
"Ref": "Testapi"
},
"method": "ANY"
"method": "*"
}
]
}
Expand All @@ -243,14 +243,14 @@
"api": {
"Ref": "Testapi"
},
"method": "ANY"
"method": "*"
}
]
}
},
"Type": "AWS::Lambda::Permission"
},
"TestapiProductsAbcdANYDefaultLambdaPermission": {
"TestapiProductsAbcdGETDefaultLambdaPermission": {
"Properties": {
"Action": "lambda:InvokeFunction",
"FunctionName": {
Expand All @@ -264,7 +264,7 @@
"api": {
"Ref": "Testapi"
},
"method": "ANY"
"method": "GET"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
"api": {
"Ref": "Testapi"
},
"method": "ANY"
"method": "*"
}
]
}
Expand All @@ -197,7 +197,7 @@
"api": {
"Ref": "Testapi"
},
"method": "ANY"
"method": "*"
}
]
}
Expand Down

0 comments on commit 319d4fd

Please sign in to comment.