-
Notifications
You must be signed in to change notification settings - Fork 2
43 lines (34 loc) · 1.22 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Test Setup Provisioned Concurrency Action
on:
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v3
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Run the action
id: run-action
uses: ./
with:
function-name: 'test-lambda-function'
provisioned-concurrency: 1
- name: Cleanup
run: |
# Retrieve the current version of the Lambda function
NEW_VERSION=$(aws lambda list-versions-by-function --function-name test-lambda-function --query 'Versions[-1].[Version]' --output text)
echo "Current version is $NEW_VERSION"
# Remove provisioned concurrency
aws lambda delete-provisioned-concurrency-config \
--function-name test-lambda-function \
--qualifier $NEW_VERSION
# Delete the version
aws lambda delete-function --function-name test-lambda-function --qualifier $NEW_VERSION