Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/run-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion lambda-integration-tests/samconfig.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ lint = true
[default.deploy.parameters]
capabilities = "CAPABILITY_IAM"
confirm_changeset = true
resolve_s3 = true

[default.sync.parameters]
watch = true
Expand Down
1 change: 1 addition & 0 deletions lambda-integration-tests/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Resources:
Metadata:
BuildMethod: java21
Properties:
FunctionName: !Sub "${AWS::StackName}-fn"
CodeUri: log4j2-test-function/
Handler: integ.Log4j2TestHandler::handleRequest
Runtime: java21
Expand Down