mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
testing layer approach
This commit is contained in:
parent
9af95667b5
commit
59de8e8cd3
4 changed files with 17 additions and 9 deletions
13
.github/workflows/deploy_fastapi_backend.yml
vendored
13
.github/workflows/deploy_fastapi_backend.yml
vendored
|
|
@ -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)] }}"
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
1
backend/requirements/lambda.txt
Normal file
1
backend/requirements/lambda.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
cryptography==37.0.4
|
||||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue