diff --git a/src/e3/aws/troposphere/apigateway/__init__.py b/src/e3/aws/troposphere/apigateway/__init__.py index 1bb77db..c5c230f 100644 --- a/src/e3/aws/troposphere/apigateway/__init__.py +++ b/src/e3/aws/troposphere/apigateway/__init__.py @@ -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, }, ), ) diff --git a/tests/tests_e3_aws/troposphere/apigateway/apigateway_test.py b/tests/tests_e3_aws/troposphere/apigateway/apigateway_test.py index 5a94dbe..f3c5825 100644 --- a/tests/tests_e3_aws/troposphere/apigateway/apigateway_test.py +++ b/tests/tests_e3_aws/troposphere/apigateway/apigateway_test.py @@ -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")])], ), ], ) diff --git a/tests/tests_e3_aws/troposphere/apigateway/apigatewayv1_test.json b/tests/tests_e3_aws/troposphere/apigateway/apigatewayv1_test.json index 16abfb8..a2a5e65 100644 --- a/tests/tests_e3_aws/troposphere/apigateway/apigatewayv1_test.json +++ b/tests/tests_e3_aws/troposphere/apigateway/apigatewayv1_test.json @@ -130,7 +130,7 @@ "api": { "Ref": "Testapi" }, - "method": "ANY" + "method": "*" } ] } diff --git a/tests/tests_e3_aws/troposphere/apigateway/apigatewayv1_test_custom_domain.json b/tests/tests_e3_aws/troposphere/apigateway/apigatewayv1_test_custom_domain.json index 4a4c7a2..7b6c1ef 100644 --- a/tests/tests_e3_aws/troposphere/apigateway/apigatewayv1_test_custom_domain.json +++ b/tests/tests_e3_aws/troposphere/apigateway/apigatewayv1_test_custom_domain.json @@ -159,7 +159,7 @@ "api": { "Ref": "Testapi" }, - "method": "ANY" + "method": "*" } ] } diff --git a/tests/tests_e3_aws/troposphere/apigateway/apigatewayv1_test_custom_domain_stages.json b/tests/tests_e3_aws/troposphere/apigateway/apigatewayv1_test_custom_domain_stages.json index a09c883..69a0fa9 100644 --- a/tests/tests_e3_aws/troposphere/apigateway/apigatewayv1_test_custom_domain_stages.json +++ b/tests/tests_e3_aws/troposphere/apigateway/apigatewayv1_test_custom_domain_stages.json @@ -205,7 +205,7 @@ "api": { "Ref": "Testapi" }, - "method": "ANY" + "method": "*" } ] } @@ -226,7 +226,7 @@ "api": { "Ref": "Testapi" }, - "method": "ANY" + "method": "*" } ] } diff --git a/tests/tests_e3_aws/troposphere/apigateway/apigatewayv1_test_lambda_alias.json b/tests/tests_e3_aws/troposphere/apigateway/apigatewayv1_test_lambda_alias.json index ac18d39..ea8a144 100644 --- a/tests/tests_e3_aws/troposphere/apigateway/apigatewayv1_test_lambda_alias.json +++ b/tests/tests_e3_aws/troposphere/apigateway/apigatewayv1_test_lambda_alias.json @@ -170,7 +170,7 @@ "api": { "Ref": "Testapi" }, - "method": "ANY" + "method": "*" } ] } @@ -191,7 +191,7 @@ "api": { "Ref": "Testapi" }, - "method": "ANY" + "method": "*" } ] } diff --git a/tests/tests_e3_aws/troposphere/apigateway/apigatewayv1_test_nested_resources.json b/tests/tests_e3_aws/troposphere/apigateway/apigatewayv1_test_nested_resources.json index 99b437d..14e3ccb 100644 --- a/tests/tests_e3_aws/troposphere/apigateway/apigatewayv1_test_nested_resources.json +++ b/tests/tests_e3_aws/troposphere/apigateway/apigatewayv1_test_nested_resources.json @@ -84,7 +84,7 @@ "DependsOn": [ "TestapiAccountsANYMethod", "TestapiProductsANYMethod", - "TestapiProductsAbcdANYMethod" + "TestapiProductsAbcdGETMethod" ] }, "TestapiDefaultStage": { @@ -178,13 +178,13 @@ }, "Type": "AWS::ApiGateway::Method" }, - "TestapiProductsAbcdANYMethod": { + "TestapiProductsAbcdGETMethod": { "Properties": { "RestApiId": { "Ref": "Testapi" }, "AuthorizationType": "NONE", - "HttpMethod": "ANY", + "HttpMethod": "GET", "Integration": { "CacheKeyParameters": [], "CacheNamespace": "none", @@ -222,7 +222,7 @@ "api": { "Ref": "Testapi" }, - "method": "ANY" + "method": "*" } ] } @@ -243,14 +243,14 @@ "api": { "Ref": "Testapi" }, - "method": "ANY" + "method": "*" } ] } }, "Type": "AWS::Lambda::Permission" }, - "TestapiProductsAbcdANYDefaultLambdaPermission": { + "TestapiProductsAbcdGETDefaultLambdaPermission": { "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { @@ -264,7 +264,7 @@ "api": { "Ref": "Testapi" }, - "method": "ANY" + "method": "GET" } ] } diff --git a/tests/tests_e3_aws/troposphere/apigateway/apigatewayv1_test_stages.json b/tests/tests_e3_aws/troposphere/apigateway/apigatewayv1_test_stages.json index 1335b15..7a1ff56 100644 --- a/tests/tests_e3_aws/troposphere/apigateway/apigatewayv1_test_stages.json +++ b/tests/tests_e3_aws/troposphere/apigateway/apigatewayv1_test_stages.json @@ -176,7 +176,7 @@ "api": { "Ref": "Testapi" }, - "method": "ANY" + "method": "*" } ] } @@ -197,7 +197,7 @@ "api": { "Ref": "Testapi" }, - "method": "ANY" + "method": "*" } ] }