Skip to content

BCDA-8360 add waf sync lambda #7

BCDA-8360 add waf sync lambda

BCDA-8360 add waf sync lambda #7

name: WAF Sync Lambda Integration Tests
on:
pull_request:
paths:
- .github/workflows/waf-sync-lambda-integration-test.yml
- .github/workflows/waf-sync-lambda-dev-deploy.yml
- .github/workflows/waf-sync-lambda-test-deploy.yml
- .github/workflows/waf-sync-lambda-prod-deploy.yml
- lambda/wafsync/**
workflow_dispatch:
# Ensure we have only one integration test running at a time
concurrency:
group: waf-sync-lambda-integration-test
jobs:
# Deploy first if triggered by pull_request
deploy:
if: ${{ github.event_name == 'pull_request' }}
uses: ./.github/workflows/waf-sync-lambda-dev-deploy.yml
secrets: inherit
trigger:
if: ${{ always() }}
needs: deploy
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./lambda/wafsync
outputs:
start_time: ${{ steps.invoke-lambda.outputs.STARTTIME }}
steps:
- uses: actions/checkout@v4
- uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ vars.AWS_REGION }}
role-to-assume: arn:aws:iam::${{ secrets.ACCOUNT_ID }}:role/delegatedadmin/developer/bcda-dev-github-actions
- name: Send event to trigger lambda function
id: invoke-lambda
run: |
echo "STARTTIME=`date +%s`" >> "$GITHUB_OUTPUT"
aws lambda invoke --function-name bcda-dev-api-waf-sync-function test-result.txt