Merge pull request #144 from Hestia-Homes/main

added the reference to the github sha in the lambda function uri inst…
This commit is contained in:
KhalimCK 2023-08-24 10:57:53 +01:00 committed by GitHub
commit a4f4e8a16d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -91,6 +91,7 @@ jobs:
DB_PORT: ${{ steps.set_db_credentials.outputs.db_port }} DB_PORT: ${{ steps.set_db_credentials.outputs.db_port }}
DB_NAME: ${{ steps.set_db_credentials.outputs.db_name }} DB_NAME: ${{ steps.set_db_credentials.outputs.db_name }}
ECR_URI: ${{ steps.set_ecr_credentials.outputs.ecr_uri }} ECR_URI: ${{ steps.set_ecr_credentials.outputs.ecr_uri }}
GITHUB_SHA: ${{ github.sha }}
run: | run: |
# Fetch database credentials from AWS Secrets Manager # Fetch database credentials from AWS Secrets Manager
SECRET_VALUE=$(aws secretsmanager get-secret-value --secret-id ${{ github.ref_name }}/assessment_model/db_credentials --query SecretString) SECRET_VALUE=$(aws secretsmanager get-secret-value --secret-id ${{ github.ref_name }}/assessment_model/db_credentials --query SecretString)

View file

@ -17,6 +17,7 @@ provider:
DB_PASSWORD: ${env:DB_PASSWORD} DB_PASSWORD: ${env:DB_PASSWORD}
DB_PORT: ${env:DB_PORT} DB_PORT: ${env:DB_PORT}
ECR_URI: ${env:ECR_URI} ECR_URI: ${env:ECR_URI}
GITHUB_SHA: ${env:GITHUB_SHA}
# Give lambda access to read from the bucket # Give lambda access to read from the bucket
iam: iam:
role: role:
@ -43,7 +44,7 @@ custom:
functions: functions:
app: app:
image: image:
uri: ${env:ECR_URI}:latest uri: ${env:ECR_URI}:${env:GITHUB_SHA}
events: events:
- http: - http:
path: /{proxy+} path: /{proxy+}