From cffc264baa32c1735c86e91e89e65810024307ff Mon Sep 17 00:00:00 2001 From: Fabiana Severin Date: Thu, 2 Jul 2026 17:02:17 +0100 Subject: [PATCH 1/3] fix: remove resolve_s3 from samconfig to avoid conflict with --s3-bucket --- lambda-integration-tests/samconfig.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/lambda-integration-tests/samconfig.toml b/lambda-integration-tests/samconfig.toml index 5e659786..f1f665e4 100644 --- a/lambda-integration-tests/samconfig.toml +++ b/lambda-integration-tests/samconfig.toml @@ -12,7 +12,6 @@ lint = true [default.deploy.parameters] capabilities = "CAPABILITY_IAM" confirm_changeset = true -resolve_s3 = true [default.sync.parameters] watch = true From fff1ffc83f3fcc0314f76c798d9963b337b2bff6 Mon Sep 17 00:00:00 2001 From: Davide Melfi Date: Thu, 2 Jul 2026 18:59:13 +0100 Subject: [PATCH 2/3] chore: introducing functionName --- lambda-integration-tests/template.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/lambda-integration-tests/template.yaml b/lambda-integration-tests/template.yaml index 01a10a70..a12e5f65 100644 --- a/lambda-integration-tests/template.yaml +++ b/lambda-integration-tests/template.yaml @@ -23,6 +23,7 @@ Resources: Metadata: BuildMethod: java21 Properties: + FunctionName: !Sub "${AWS::StackName}-fn" CodeUri: log4j2-test-function/ Handler: integ.Log4j2TestHandler::handleRequest Runtime: java21 From 3af9bdf819844738ccf632f695dd06f98d3c5eb1 Mon Sep 17 00:00:00 2001 From: Fabiana Severin Date: Fri, 3 Jul 2026 10:56:42 +0100 Subject: [PATCH 3/3] fix: verify stack status after deploy before running tests --- .github/workflows/run-integration-test.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/run-integration-test.yml b/.github/workflows/run-integration-test.yml index 1b857f45..ad46d7fd 100644 --- a/.github/workflows/run-integration-test.yml +++ b/.github/workflows/run-integration-test.yml @@ -101,6 +101,24 @@ jobs: --s3-bucket "${{ secrets.S3_BUCKET_LOG4J2_INTEG_TEST }}" \ --capabilities CAPABILITY_IAM \ 2>&1 | tee /tmp/sam-deploy.log | tail -n 20 + + # Verify stack is in a healthy state + STACK_STATUS=$(aws cloudformation describe-stacks \ + --stack-name "${stackName}" \ + --region "${AWS_REGION}" \ + --query 'Stacks[0].StackStatus' \ + --output text 2>&1) + echo "Stack status: $STACK_STATUS" + if [ "$STACK_STATUS" != "CREATE_COMPLETE" ] && [ "$STACK_STATUS" != "UPDATE_COMPLETE" ]; then + echo "FAIL: Stack is not in a healthy state (status: $STACK_STATUS)" + aws cloudformation describe-stack-events \ + --stack-name "${stackName}" \ + --region "${AWS_REGION}" \ + --query 'StackEvents[?ResourceStatus==`CREATE_FAILED` || ResourceStatus==`UPDATE_FAILED`].[LogicalResourceId,ResourceStatusReason]' \ + --output table 2>&1 || true + exit 1 + fi + LOG4J2_TEST_FUNCTION=$(sam list stack-outputs --stack-name "${stackName}" --output json | jq -r '.[] | select(.OutputKey=="Log4j2TestFunction") | .OutputValue') echo "LOG4J2_TEST_FUNCTION=$LOG4J2_TEST_FUNCTION" >> "$GITHUB_OUTPUT" echo "Function name: $LOG4J2_TEST_FUNCTION"