mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
81 lines
No EOL
2 KiB
YAML
81 lines
No EOL
2 KiB
YAML
service: fastapi-lambda
|
|
|
|
provider:
|
|
name: aws
|
|
runtime: python3.10
|
|
region: eu-west-2
|
|
architecture: x86_64
|
|
environment:
|
|
API_KEY: ${env:API_KEY}
|
|
ENVIRONMENT: ${env:ENVIRONMENT}
|
|
SECRET_KEY: ${env:SECRET_KEY}
|
|
PLAN_TRIGGER_BUCKET: ${env:PLAN_TRIGGER_BUCKET}
|
|
DOMAIN_NAME: ${env:DOMAIN_NAME}
|
|
EPC_AUTH_TOKEN: ${env:EPC_AUTH_TOKEN}
|
|
# Give lambda access to read from the bucket
|
|
iam:
|
|
role:
|
|
name: fastapi_backend_${env:PLAN_TRIGGER_BUCKET}_access
|
|
statements:
|
|
- Effect: Allow
|
|
Action:
|
|
- s3:GetObject
|
|
- s3:ListBucket
|
|
Resource:
|
|
- arn:aws:s3:::${env:PLAN_TRIGGER_BUCKET}
|
|
- arn:aws:s3:::${env:PLAN_TRIGGER_BUCKET}/*
|
|
|
|
|
|
package:
|
|
individually: true
|
|
patterns:
|
|
- backend/**
|
|
- !backend/tests/**
|
|
- recommendations/**
|
|
- !recommendations/tests/**
|
|
- model_data/BaseUtility.py
|
|
- !model_data/**
|
|
- !infrastructure/**
|
|
- !data_collection/**
|
|
- !node_modules/**
|
|
- !conservation_areas/**
|
|
- !open_uprn/**
|
|
- !land_registry/**
|
|
- !pytest.ini
|
|
# exclude:
|
|
# - model_data/local_data/**
|
|
# - model_data/tests/**
|
|
# - infrastructure/**
|
|
# - data_collection/**
|
|
# - node_modules/**
|
|
# - conservation_areas/**
|
|
# - open_uprn/**
|
|
# - land_registry/**
|
|
# - recommendations/tests/**
|
|
# - pytest.ini
|
|
|
|
plugins:
|
|
- serverless-python-requirements
|
|
- serverless-domain-manager
|
|
|
|
custom:
|
|
pythonRequirements:
|
|
dockerizePip: true
|
|
dockerFile: backend/docker/Dockerfile
|
|
useDocker: true
|
|
dockerSsh: true
|
|
fileName: serverless_requirements.txt
|
|
dockerBuildCmdExtraArgs:
|
|
- '--progress=plain'
|
|
customDomain:
|
|
domainName: api.${self:provider.environment.DOMAIN_NAME}
|
|
createRoute53Record: true
|
|
certificateArn: ${ssm:/ssl_certificate_arn}
|
|
|
|
functions:
|
|
app:
|
|
handler: backend.app.main.handler
|
|
events:
|
|
- http:
|
|
path: /{proxy+}
|
|
method: ANY |