From 5ad20e239c91ba557f5a235bbd958e62ab4a84b2 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Thu, 4 Apr 2024 16:41:20 +0000 Subject: [PATCH] Update lambda python runtime version in integration tests (#2065) (#2068) [PR #2065/915cb0d5 backport][stable-7] Update lambda python runtime version in integration tests This is a backport of PR #2065 as merged into main (915cb0d). SUMMARY The elb_target and s3_bucket_notification integration test targets were failing due to the python3.7 runtime no longer being supported. I have updated this to python3.12. While at it I went ahead and updated the secretsmanager_secret and sns_topic target runtimes from python3.9 to python3.12 too. ISSUE TYPE Bugfix Pull Request Reviewed-by: Mike Graves Reviewed-by: Alina Buzachis --- changelogs/fragments/20240402-lambda-test-runtime.yml | 2 ++ tests/integration/targets/elb_target/tasks/lambda_target.yml | 2 +- .../tasks/test_lambda_notifications.yml | 2 +- .../targets/secretsmanager_secret/tasks/rotation.yml | 4 ++-- tests/integration/targets/sns_topic/tasks/main.yml | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 changelogs/fragments/20240402-lambda-test-runtime.yml diff --git a/changelogs/fragments/20240402-lambda-test-runtime.yml b/changelogs/fragments/20240402-lambda-test-runtime.yml new file mode 100644 index 00000000000..ef86b61a42e --- /dev/null +++ b/changelogs/fragments/20240402-lambda-test-runtime.yml @@ -0,0 +1,2 @@ +trivial: + - integration tests - update lambda ``runtime`` parameter to python3.12 (https://github.com/ansible-collections/community.aws/pull/2065). diff --git a/tests/integration/targets/elb_target/tasks/lambda_target.yml b/tests/integration/targets/elb_target/tasks/lambda_target.yml index abc4cc5d084..c4271cdd655 100644 --- a/tests/integration/targets/elb_target/tasks/lambda_target.yml +++ b/tests/integration/targets/elb_target/tasks/lambda_target.yml @@ -23,7 +23,7 @@ name: "{{ lambda_name }}" state: present zip_file: /tmp/lambda.zip - runtime: python3.7 + runtime: python3.12 role: "{{ ROLE_ARN.arn }}" handler: ansible_lambda_target.lambda_handler timeout: 30 diff --git a/tests/integration/targets/s3_bucket_notification/tasks/test_lambda_notifications.yml b/tests/integration/targets/s3_bucket_notification/tasks/test_lambda_notifications.yml index 23ed32e3215..b4cc8a6e037 100644 --- a/tests/integration/targets/s3_bucket_notification/tasks/test_lambda_notifications.yml +++ b/tests/integration/targets/s3_bucket_notification/tasks/test_lambda_notifications.yml @@ -41,7 +41,7 @@ name: '{{ lambda_name }}' state: present role: "{{ lambda_role_name }}" - runtime: python3.7 + runtime: python3.12 zip_file: '{{function_res.dest}}' handler: lambda_function.lambda_handler memory_size: '128' diff --git a/tests/integration/targets/secretsmanager_secret/tasks/rotation.yml b/tests/integration/targets/secretsmanager_secret/tasks/rotation.yml index 697c5ecc279..77151227dc8 100644 --- a/tests/integration/targets/secretsmanager_secret/tasks/rotation.yml +++ b/tests/integration/targets/secretsmanager_secret/tasks/rotation.yml @@ -55,7 +55,7 @@ name: "{{ lambda_name }}" state: present zip_file: "{{ tmp.path }}/hello_world.zip" - runtime: 'python3.9' + runtime: 'python3.12' role: "{{ iam_role_output.arn }}" handler: 'hello_world.lambda_handler' register: lambda_output @@ -169,7 +169,7 @@ name: "{{ lambda_name }}" state: absent zip_file: "{{ tmp.path }}/hello_world.zip" - runtime: 'python3.9' + runtime: 'python3.12' role: "{{ secret_manager_role }}" handler: 'hello_world.lambda_handler' ignore_errors: yes diff --git a/tests/integration/targets/sns_topic/tasks/main.yml b/tests/integration/targets/sns_topic/tasks/main.yml index 00f3f71d96a..25f6368320a 100644 --- a/tests/integration/targets/sns_topic/tasks/main.yml +++ b/tests/integration/targets/sns_topic/tasks/main.yml @@ -309,7 +309,7 @@ name: '{{ sns_topic_lambda_name }}' state: present zip_file: '{{ tempdir.path }}/{{ sns_topic_lambda_function }}.zip' - runtime: python3.9 + runtime: python3.12 role: '{{ sns_topic_lambda_role }}' handler: '{{ sns_topic_lambda_function }}.handler' register: lambda_result