testing layer approach

This commit is contained in:
Khalim Conn-Kowlessar 2023-07-17 20:59:22 +01:00
parent 9af95667b5
commit 59de8e8cd3
4 changed files with 17 additions and 9 deletions

View file

@ -44,6 +44,19 @@ jobs:
aws-secret-access-key: ${{ secrets.PROD_AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-2
- name: Install lambda specific dependencies, with bianries, in a separate dir
run: |
mkdir python
pip install -r backend/requirements/lambda.txt -t python
- name: Create Layer package
run: |
zip -r layer.zip python
- name: Deploy Layer to Lambda
run: |
aws lambda publish-layer-version --layer-name LambdaDependenciesLayer --zip-file fileb://layer.zip
- name: Set domain name
id: set_domain
run: echo "::set-output name=domain::${{ secrets[format('{0}_DOMAIN_NAME', github.ref_name)] }}"

View file

@ -1,7 +1,6 @@
anyio==3.7.1
cffi==1.15.1
click==8.1.3
cryptography==37.0.4
ecdsa==0.18.0
exceptiongroup==1.1.2
fastapi==0.99.1

View file

@ -0,0 +1 @@
cryptography==37.0.4

View file

@ -4,7 +4,7 @@ provider:
name: aws
runtime: python3.10
region: eu-west-2
architecture: arm64
architecture: x86_64
environment:
API_KEY: ${env:API_KEY}
ENVIRONMENT: ${env:ENVIRONMENT}
@ -12,7 +12,6 @@ provider:
PLAN_TRIGGER_BUCKET: ${env:PLAN_TRIGGER_BUCKET}
DOMAIN_NAME: ${env:DOMAIN_NAME}
package:
individually: true
include:
@ -37,13 +36,9 @@ custom:
functions:
app:
handler: app.main.handler
layers:
- { Ref: LambdaDependenciesLayerLambdaLayer }
events:
- http:
path: /{proxy+}
method: ANY
# vpc:
# securityGroupIds:
# - sg-0abcd1234efgh5678
# subnetIds:
# - subnet-a1b2c3d4
# - subnet-e5f6g7h8