Skip to content

WAF Sync Lambda test deploy #4

WAF Sync Lambda test deploy

WAF Sync Lambda test deploy #4

name: WAF Sync Lambda test deploy
on:
workflow_call:
workflow_dispatch:
jobs:
deploy-to-test:
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./lambda/wafsync
environment: test
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
- name: Build WAF Sync Lambda zip file
env:
CGO_ENABLED: 0
run: |
go build -o bootstrap main.go db.go aws.go
zip function.zip bootstrap
- 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-test-github-actions
- name: Upload and reload
run: |
aws s3 cp --no-progress function.zip \
s3://bcda-test-api-waf-sync-function/function-${{ github.sha }}.zip
aws lambda update-function-code --function-name bcda-test-api-waf-sync \
--s3-bucket bcda-test-api-waf-sync-function --s3-key function-${{ github.sha }}.zip