From 1602bd560ad743693ec6899d69dd6ef7de65bcd6 Mon Sep 17 00:00:00 2001 From: Renato Valenzuela Date: Wed, 18 Mar 2026 21:17:37 +0000 Subject: [PATCH 1/3] fix: remove manual role in durable functions In the initial launch, SAM didn't automatically create the appropriate role to use with durable functions, but that's been fixed for a while. --- .../template.yaml | 18 ------------------ .../template.yaml | 18 ------------------ .../template.yaml | 18 ------------------ .../template.yaml | 18 ------------------ 4 files changed, 72 deletions(-) diff --git a/nodejs22.x/hello-durable-ts/{{cookiecutter.project_name}}/template.yaml b/nodejs22.x/hello-durable-ts/{{cookiecutter.project_name}}/template.yaml index 8ceb8dfc..f4001b26 100644 --- a/nodejs22.x/hello-durable-ts/{{cookiecutter.project_name}}/template.yaml +++ b/nodejs22.x/hello-durable-ts/{{cookiecutter.project_name}}/template.yaml @@ -6,20 +6,6 @@ Description: > Sample SAM Template for {{ cookiecutter.project_name }} Resources: - # TODO: No longer necessary after https://github.com/aws/serverless-application-model/pull/3854 - DurableFunctionRole: - Type: AWS::IAM::Role - Properties: - AssumeRolePolicyDocument: - Version: '2012-10-17' - Statement: - - Effect: Allow - Principal: - Service: lambda.amazonaws.com - Action: sts:AssumeRole - ManagedPolicyArns: - - arn:aws:iam::aws:policy/service-role/AWSLambdaBasicDurableExecutionRolePolicy - HelloWorldFunction: Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction Properties: @@ -33,7 +19,6 @@ Resources: - {{arch}} {%- endfor %} {%- endif %} - Role: !GetAtt DurableFunctionRole.Arn AutoPublishAlias: Live DurableConfig: ExecutionTimeout: 900 @@ -64,6 +49,3 @@ Outputs: HelloWorldFunction: Description: "Hello World Lambda Function ARN" Value: !GetAtt HelloWorldFunction.Arn - HelloWorldFunctionIamRole: - Description: "IAM Role for Hello World function" - Value: !GetAtt DurableFunctionRole.Arn diff --git a/nodejs24.x/hello-durable-ts/{{cookiecutter.project_name}}/template.yaml b/nodejs24.x/hello-durable-ts/{{cookiecutter.project_name}}/template.yaml index d144e8c5..00424e47 100644 --- a/nodejs24.x/hello-durable-ts/{{cookiecutter.project_name}}/template.yaml +++ b/nodejs24.x/hello-durable-ts/{{cookiecutter.project_name}}/template.yaml @@ -6,20 +6,6 @@ Description: > Sample SAM Template for {{ cookiecutter.project_name }} Resources: - # TODO: No longer necessary after https://github.com/aws/serverless-application-model/pull/3854 - DurableFunctionRole: - Type: AWS::IAM::Role - Properties: - AssumeRolePolicyDocument: - Version: '2012-10-17' - Statement: - - Effect: Allow - Principal: - Service: lambda.amazonaws.com - Action: sts:AssumeRole - ManagedPolicyArns: - - arn:aws:iam::aws:policy/service-role/AWSLambdaBasicDurableExecutionRolePolicy - HelloWorldFunction: Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction Properties: @@ -33,7 +19,6 @@ Resources: - {{arch}} {%- endfor %} {%- endif %} - Role: !GetAtt DurableFunctionRole.Arn AutoPublishAlias: Live DurableConfig: ExecutionTimeout: 900 @@ -64,6 +49,3 @@ Outputs: HelloWorldFunction: Description: "Hello World Lambda Function ARN" Value: !GetAtt HelloWorldFunction.Arn - HelloWorldFunctionIamRole: - Description: "IAM Role for Hello World function" - Value: !GetAtt DurableFunctionRole.Arn diff --git a/python3.13/hello-durable/{{cookiecutter.project_name}}/template.yaml b/python3.13/hello-durable/{{cookiecutter.project_name}}/template.yaml index edab15f4..78d72418 100644 --- a/python3.13/hello-durable/{{cookiecutter.project_name}}/template.yaml +++ b/python3.13/hello-durable/{{cookiecutter.project_name}}/template.yaml @@ -6,20 +6,6 @@ Description: > Sample SAM Template for {{ cookiecutter.project_name }} Resources: - # TODO: No longer necessary after https://github.com/aws/serverless-application-model/pull/3854 - DurableFunctionRole: - Type: AWS::IAM::Role - Properties: - AssumeRolePolicyDocument: - Version: '2012-10-17' - Statement: - - Effect: Allow - Principal: - Service: lambda.amazonaws.com - Action: sts:AssumeRole - ManagedPolicyArns: - - arn:aws:iam::aws:policy/service-role/AWSLambdaBasicDurableExecutionRolePolicy - HelloWorldFunction: Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction Properties: @@ -33,7 +19,6 @@ Resources: - {{arch}} {%- endfor %} {%- endif %} - Role: !GetAtt DurableFunctionRole.Arn AutoPublishAlias: Live DurableConfig: ExecutionTimeout: 900 @@ -55,6 +40,3 @@ Outputs: HelloWorldFunction: Description: "Hello World Lambda Function ARN" Value: !GetAtt HelloWorldFunction.Arn - HelloWorldFunctionIamRole: - Description: "IAM Role for Hello World function" - Value: !GetAtt DurableFunctionRole.Arn diff --git a/python3.14/hello-durable/{{cookiecutter.project_name}}/template.yaml b/python3.14/hello-durable/{{cookiecutter.project_name}}/template.yaml index 0071d5e7..29550391 100644 --- a/python3.14/hello-durable/{{cookiecutter.project_name}}/template.yaml +++ b/python3.14/hello-durable/{{cookiecutter.project_name}}/template.yaml @@ -6,20 +6,6 @@ Description: > Sample SAM Template for {{ cookiecutter.project_name }} Resources: - # TODO: No longer necessary after https://github.com/aws/serverless-application-model/pull/3854 - DurableFunctionRole: - Type: AWS::IAM::Role - Properties: - AssumeRolePolicyDocument: - Version: '2012-10-17' - Statement: - - Effect: Allow - Principal: - Service: lambda.amazonaws.com - Action: sts:AssumeRole - ManagedPolicyArns: - - arn:aws:iam::aws:policy/service-role/AWSLambdaBasicDurableExecutionRolePolicy - HelloWorldFunction: Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction Properties: @@ -33,7 +19,6 @@ Resources: - {{arch}} {%- endfor %} {%- endif %} - Role: !GetAtt DurableFunctionRole.Arn AutoPublishAlias: Live DurableConfig: ExecutionTimeout: 900 @@ -55,6 +40,3 @@ Outputs: HelloWorldFunction: Description: "Hello World Lambda Function ARN" Value: !GetAtt HelloWorldFunction.Arn - HelloWorldFunctionIamRole: - Description: "IAM Role for Hello World function" - Value: !GetAtt DurableFunctionRole.Arn From 0c922851f6c47daa2065ef9adda9e1277a008717 Mon Sep 17 00:00:00 2001 From: Renato Valenzuela Date: Wed, 18 Mar 2026 21:44:01 +0000 Subject: [PATCH 2/3] chore: remove py3.9 tests. Minor fixes to other tests --- .github/workflows/build_test_invoke.yml | 25 +++----- .../{{cookiecutter.project_name}}/Dockerfile | 2 +- .../{{cookiecutter.project_name}}/Dockerfile | 2 +- .../build_invoke/python/test_python_3_9.py | 60 ------------------- .../unit_test/test_unit_test_python3_14.py | 2 +- .../unit_test/test_unit_test_python3_9.py | 55 ----------------- 6 files changed, 12 insertions(+), 134 deletions(-) delete mode 100644 tests/integration/build_invoke/python/test_python_3_9.py delete mode 100644 tests/integration/unit_test/test_unit_test_python3_9.py diff --git a/.github/workflows/build_test_invoke.yml b/.github/workflows/build_test_invoke.yml index 4c6959de..2e6e7a19 100644 --- a/.github/workflows/build_test_invoke.yml +++ b/.github/workflows/build_test_invoke.yml @@ -72,12 +72,6 @@ jobs: fail-fast: false matrix: include: - - version: '3.9' - type: 'Test' - file: 'tests/integration/unit_test/test_unit_test_python3_9.py' - - version: '3.9' - type: 'Invoke' - file: 'tests/integration/build_invoke/python/test_python_3_9.py' - version: '3.10' type: 'Test' file: 'tests/integration/unit_test/test_unit_test_python3_10.py' @@ -102,12 +96,12 @@ jobs: - version: '3.13' type: 'Invoke' file: 'tests/integration/build_invoke/python/test_python_3_13.py' - # - version: '3.14' - # type: 'Test' - # file: 'tests/integration/unit_test/test_unit_test_python3_14.py' - # - version: '3.14' - # type: 'Invoke' - # file: 'tests/integration/build_invoke/python/test_python_3_14.py' + - version: '3.14' + type: 'Test' + file: 'tests/integration/unit_test/test_unit_test_python3_14.py' + - version: '3.14' + type: 'Invoke' + file: 'tests/integration/build_invoke/python/test_python_3_14.py' env: PYTHON_VERSION_INSTALL: ${{ matrix.version }} runs-on: ubuntu-latest @@ -256,10 +250,9 @@ jobs: - version: '3.4' type: 'Test' file: 'tests/integration/unit_test/test_unit_test_ruby3_4.py' - # Uncomment after SAM CLI supports Ruby3.4 and the build image is available - # - version: '3.4' - # type: 'Invoke' - # file: 'tests/integration/build_invoke/ruby/test_ruby_3_4.py' + - version: '3.4' + type: 'Invoke' + file: 'tests/integration/build_invoke/ruby/test_ruby_3_4.py' runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 diff --git a/al2/graalvm/11/maven/{{cookiecutter.project_name}}/Dockerfile b/al2/graalvm/11/maven/{{cookiecutter.project_name}}/Dockerfile index cc0ec353..3d0b34d2 100644 --- a/al2/graalvm/11/maven/{{cookiecutter.project_name}}/Dockerfile +++ b/al2/graalvm/11/maven/{{cookiecutter.project_name}}/Dockerfile @@ -24,7 +24,7 @@ RUN mv $GRAAL_FOLDERNAME /usr/lib/graalvm RUN rm -rf $GRAAL_FOLDERNAME # Maven -ENV MVN_VERSION 3.9.12 +ENV MVN_VERSION 3.9.14 ENV MVN_FOLDERNAME apache-maven-${MVN_VERSION} ENV MVN_FILENAME apache-maven-${MVN_VERSION}-bin.tar.gz RUN curl -4 -L https://dlcdn.apache.org/maven/maven-3/${MVN_VERSION}/binaries/${MVN_FILENAME} | tar -xvz diff --git a/al2/graalvm/17/maven/{{cookiecutter.project_name}}/Dockerfile b/al2/graalvm/17/maven/{{cookiecutter.project_name}}/Dockerfile index 26226074..e3f2ea6b 100644 --- a/al2/graalvm/17/maven/{{cookiecutter.project_name}}/Dockerfile +++ b/al2/graalvm/17/maven/{{cookiecutter.project_name}}/Dockerfile @@ -11,7 +11,7 @@ RUN yum -y update \ && rm -rf /var/cache/yum # Maven -ENV MVN_VERSION 3.9.12 +ENV MVN_VERSION 3.9.14 ENV MVN_FOLDERNAME apache-maven-${MVN_VERSION} ENV MVN_FILENAME apache-maven-${MVN_VERSION}-bin.tar.gz RUN curl -4 -L https://dlcdn.apache.org/maven/maven-3/${MVN_VERSION}/binaries/${MVN_FILENAME} | tar -xvz diff --git a/tests/integration/build_invoke/python/test_python_3_9.py b/tests/integration/build_invoke/python/test_python_3_9.py deleted file mode 100644 index fb0b80b2..00000000 --- a/tests/integration/build_invoke/python/test_python_3_9.py +++ /dev/null @@ -1,60 +0,0 @@ -from unittest import skip -from tests.integration.build_invoke.build_invoke_base import BuildInvokeBase - -""" -For each template, it will test the following sam commands: -1. sam init -2. sam build --use-container (if self.use_container is False, --use-container will be omitted) -3. (if there are event jsons), for each event json, check `sam local invoke` response is a valid json -""" - -class BuildInvoke_python3_9_cookiecutter_aws_sam_hello_python(BuildInvokeBase.SimpleHelloWorldBuildInvokeBase): - directory = "python3.9/hello" - - -class BuildInvoke_python3_9_cookiecutter_aws_sam_eventBridge_python( - BuildInvokeBase.EventBridgeHelloWorldBuildInvokeBase -): - directory = "python3.9/event-bridge" - -class BuildInvoke_python3_9_cookiecutter_aws_sam_quick_start_web_with_connectors(BuildInvokeBase.QuickStartWebBuildInvokeBase): - directory = "python3.9/web-conn" - - -class BuildInvoke_python3_9_cookiecutter_aws_sam_step_functions_with_connectors(BuildInvokeBase.BuildInvokeBase): - directory = "python3.9/step-func-conn" - - -@skip("eventbridge schema app requires credential to pull missing files, skip") -class BuildInvoke_python3_9_cookiecutter_aws_sam_eventbridge_schema_app_python(BuildInvokeBase.BuildInvokeBase): - directory = "python3.9/event-bridge-schema" - - -class BuildInvoke_python3_9_cookiecutter_aws_sam_step_functions_sample_app(BuildInvokeBase.BuildInvokeBase): - directory = "python3.9/step-func" - - -class BuildInvoke_python3_9_cookiecutter_aws_sam_efs_python(BuildInvokeBase.BuildInvokeBase): - directory = "python3.9/efs" - -class BuildInvoke_python3_9_cookiecutter_aws_sam_hello_pt_python(BuildInvokeBase.SimpleHelloWorldBuildInvokeBase): - directory = "python3.9/hello-pt" - - -# if we want to check response json, we need to setup efs - -class BuildInvoke_image_python3_9_cookiecutter_aws_sam_hello_python_lambda_image( - BuildInvokeBase.SimpleHelloWorldBuildInvokeBase -): - directory = "python3.9/hello-img" -class BuildInvoke_python3_9_pytorch(BuildInvokeBase.BuildInvokeBase): - directory = "python3.9/apigw-pytorch" - -class BuildInvoke_python3_9_scikit(BuildInvokeBase.BuildInvokeBase): - directory = "python3.9/apigw-scikit" - -class BuildInvoke_python3_9_tensorflow(BuildInvokeBase.BuildInvokeBase): - directory = "python3.9/apigw-tensorflow" - -class BuildInvoke_python3_9_xgboost(BuildInvokeBase.BuildInvokeBase): - directory = "python3.9/apigw-xgboost" \ No newline at end of file diff --git a/tests/integration/unit_test/test_unit_test_python3_14.py b/tests/integration/unit_test/test_unit_test_python3_14.py index 35691438..6e2eca43 100644 --- a/tests/integration/unit_test/test_unit_test_python3_14.py +++ b/tests/integration/unit_test/test_unit_test_python3_14.py @@ -7,7 +7,7 @@ class UnitTest_python3_14_cookiecutter_aws_sam_hello_python(UnitTestBase.Python3 class UnitTest_python3_14_cookiecutter_aws_sam_hello_durable_python(UnitTestBase.Python314UnitTestBase): - directory = "python3.13/hello-durable" + directory = "python3.14/hello-durable" code_directories = ["hello_world"] test_dependencies = True diff --git a/tests/integration/unit_test/test_unit_test_python3_9.py b/tests/integration/unit_test/test_unit_test_python3_9.py deleted file mode 100644 index f294c328..00000000 --- a/tests/integration/unit_test/test_unit_test_python3_9.py +++ /dev/null @@ -1,55 +0,0 @@ -from tests.integration.unit_test.unit_test_base import UnitTestBase - - -class UnitTest_python3_9_cookiecutter_aws_sam_hello_python(UnitTestBase.Python39UnitTestBase): - directory = "python3.9/hello" - code_directories = ["hello_world"] - -class UnitTest_python3_9_cookiecutter_aws_sam_hello_pt_python(UnitTestBase.Python39UnitTestBase): - directory = "python3.9/hello-pt" - code_directories = ["hello_world"] - -class UnitTest_python3_9_cookiecutter_aws_sam_eventBridge_python(UnitTestBase.Python39UnitTestBase): - directory = "python3.9/event-bridge" - code_directories = ["hello_world_function"] - - -class UnitTest_python3_9_cookiecutter_aws_sam_eventbridge_schema_app_python(UnitTestBase.Python39UnitTestBase): - directory = "python3.9/event-bridge-schema" - code_directories = ["hello_world_function"] - - def _test_unit_tests(self, code_directory: str): - self.skipTest("eventbridge schema app requires credential to pull missing files, skip") - pass - - -class UnitTest_python3_9_cookiecutter_aws_sam_step_functions_sample_app(UnitTestBase.Python39UnitTestBase): - directory = "python3.9/step-func" - code_directories = [ - "functions/stock_buyer", - "functions/stock_checker", - "functions/stock_seller", - ] - - -class UnitTest_python3_9_cookiecutter_aws_sam_efs_python(UnitTestBase.Python39UnitTestBase): - directory = "python3.9/efs" - code_directories = ["hello_efs"] - - -class UnitTest_python3_9_cookiecutter_aws_sam_quick_start_web_with_connectors(UnitTestBase.Python39UnitTestBase): - directory = "python3.9/web-conn" - code_directories = [ - "src/handlers/get_all_items", - "src/handlers/get_by_id", - "src/handlers/put_item" - ] - - -class UnitTest_python3_9_cookiecutter_aws_sam_step_functions_with_connectors(UnitTestBase.Python39UnitTestBase): - directory = "python3.9/step-func-conn" - code_directories = [ - "functions/stock_buyer", - "functions/stock_checker", - "functions/stock_seller", - ] From 60dfff4c8908f645a9f6ea8e87dd4b1403468e72 Mon Sep 17 00:00:00 2001 From: Reed Hamilton Date: Fri, 24 Apr 2026 10:22:46 -0700 Subject: [PATCH 3/3] chore: add back python 3.9 unit tests --- .../unit_test/test_unit_test_python3_9.py | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 tests/integration/unit_test/test_unit_test_python3_9.py diff --git a/tests/integration/unit_test/test_unit_test_python3_9.py b/tests/integration/unit_test/test_unit_test_python3_9.py new file mode 100644 index 00000000..f294c328 --- /dev/null +++ b/tests/integration/unit_test/test_unit_test_python3_9.py @@ -0,0 +1,55 @@ +from tests.integration.unit_test.unit_test_base import UnitTestBase + + +class UnitTest_python3_9_cookiecutter_aws_sam_hello_python(UnitTestBase.Python39UnitTestBase): + directory = "python3.9/hello" + code_directories = ["hello_world"] + +class UnitTest_python3_9_cookiecutter_aws_sam_hello_pt_python(UnitTestBase.Python39UnitTestBase): + directory = "python3.9/hello-pt" + code_directories = ["hello_world"] + +class UnitTest_python3_9_cookiecutter_aws_sam_eventBridge_python(UnitTestBase.Python39UnitTestBase): + directory = "python3.9/event-bridge" + code_directories = ["hello_world_function"] + + +class UnitTest_python3_9_cookiecutter_aws_sam_eventbridge_schema_app_python(UnitTestBase.Python39UnitTestBase): + directory = "python3.9/event-bridge-schema" + code_directories = ["hello_world_function"] + + def _test_unit_tests(self, code_directory: str): + self.skipTest("eventbridge schema app requires credential to pull missing files, skip") + pass + + +class UnitTest_python3_9_cookiecutter_aws_sam_step_functions_sample_app(UnitTestBase.Python39UnitTestBase): + directory = "python3.9/step-func" + code_directories = [ + "functions/stock_buyer", + "functions/stock_checker", + "functions/stock_seller", + ] + + +class UnitTest_python3_9_cookiecutter_aws_sam_efs_python(UnitTestBase.Python39UnitTestBase): + directory = "python3.9/efs" + code_directories = ["hello_efs"] + + +class UnitTest_python3_9_cookiecutter_aws_sam_quick_start_web_with_connectors(UnitTestBase.Python39UnitTestBase): + directory = "python3.9/web-conn" + code_directories = [ + "src/handlers/get_all_items", + "src/handlers/get_by_id", + "src/handlers/put_item" + ] + + +class UnitTest_python3_9_cookiecutter_aws_sam_step_functions_with_connectors(UnitTestBase.Python39UnitTestBase): + directory = "python3.9/step-func-conn" + code_directories = [ + "functions/stock_buyer", + "functions/stock_checker", + "functions/stock_seller", + ]