Skip to content

Commit ba130c1

Browse files
authored
Merge pull request #622 from aws/fabisev/fix-issue-s3-bucket
Fix log4j2 integration test deploy
2 parents 9b4df8f + 3af9bdf commit ba130c1

3 files changed

Lines changed: 19 additions & 1 deletion

File tree

.github/workflows/run-integration-test.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,24 @@ jobs:
101101
--s3-bucket "${{ secrets.S3_BUCKET_LOG4J2_INTEG_TEST }}" \
102102
--capabilities CAPABILITY_IAM \
103103
2>&1 | tee /tmp/sam-deploy.log | tail -n 20
104+
105+
# Verify stack is in a healthy state
106+
STACK_STATUS=$(aws cloudformation describe-stacks \
107+
--stack-name "${stackName}" \
108+
--region "${AWS_REGION}" \
109+
--query 'Stacks[0].StackStatus' \
110+
--output text 2>&1)
111+
echo "Stack status: $STACK_STATUS"
112+
if [ "$STACK_STATUS" != "CREATE_COMPLETE" ] && [ "$STACK_STATUS" != "UPDATE_COMPLETE" ]; then
113+
echo "FAIL: Stack is not in a healthy state (status: $STACK_STATUS)"
114+
aws cloudformation describe-stack-events \
115+
--stack-name "${stackName}" \
116+
--region "${AWS_REGION}" \
117+
--query 'StackEvents[?ResourceStatus==`CREATE_FAILED` || ResourceStatus==`UPDATE_FAILED`].[LogicalResourceId,ResourceStatusReason]' \
118+
--output table 2>&1 || true
119+
exit 1
120+
fi
121+
104122
LOG4J2_TEST_FUNCTION=$(sam list stack-outputs --stack-name "${stackName}" --output json | jq -r '.[] | select(.OutputKey=="Log4j2TestFunction") | .OutputValue')
105123
echo "LOG4J2_TEST_FUNCTION=$LOG4J2_TEST_FUNCTION" >> "$GITHUB_OUTPUT"
106124
echo "Function name: $LOG4J2_TEST_FUNCTION"

lambda-integration-tests/samconfig.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ lint = true
1212
[default.deploy.parameters]
1313
capabilities = "CAPABILITY_IAM"
1414
confirm_changeset = true
15-
resolve_s3 = true
1615

1716
[default.sync.parameters]
1817
watch = true

lambda-integration-tests/template.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Resources:
2323
Metadata:
2424
BuildMethod: java21
2525
Properties:
26+
FunctionName: !Sub "${AWS::StackName}-fn"
2627
CodeUri: log4j2-test-function/
2728
Handler: integ.Log4j2TestHandler::handleRequest
2829
Runtime: java21

0 commit comments

Comments
 (0)