File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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"
Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ lint = true
1212[default .deploy .parameters ]
1313capabilities = " CAPABILITY_IAM"
1414confirm_changeset = true
15- resolve_s3 = true
1615
1716[default .sync .parameters ]
1817watch = true
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments