Skip to content

Commit

Permalink
Merge pull request #77 from andreciornavei/develop
Browse files Browse the repository at this point in the history
add aws credentials to lambda
  • Loading branch information
andreciornavei authored Mar 8, 2024
2 parents 7fb24d5 + a5e26f2 commit 4238117
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ jobs:
echo "DB_URI=${DB_URI}" >> .env
echo "JWT_SECRET=${JWT_SECRET}" >> .env
echo "AWS_HOSTED_ZONE_ID=${AWS_HOSTED_ZONE_ID}" >> .env
echo "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}" >> .env
echo "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}" >> .env
serverless deploy --config serverless.yml --stage ${BRANCH} --region ${AWS_DEFAULT_REGION} --verbose
if: success()

Expand Down
2 changes: 1 addition & 1 deletion backend/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ DB_URI=
JWT_SECRET=

AWS_BUCKET=
AWS_DEFAULT_REGION=sa-east-1
AWS_REGION=sa-east-1
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_USE_PATH_STYLE_ENDPOINT=false
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class AwsS3Provider implements IStorageProvider
public function __construct()
{
$args = [
'region' => env('AWS_DEFAULT_REGION', "sa-east-1"),
'region' => env('AWS_REGION', "sa-east-1"),
'version' => 'latest',
];
if (getenv("AWS_ACCESS_KEY_ID") && getenv("AWS_SECRET_ACCESS_KEY")) {
Expand Down
5 changes: 5 additions & 0 deletions backend/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ params:
AWS_HOSTED_ZONE_ID: ${env:AWS_HOSTED_ZONE_ID}
SUBDOMAIN: ${env:SUBDOMAIN}.${sls:stage}.${env:DOMAIN}
BUCKET_NAME: bnb-bank-upload.${sls:stage}.${env:DOMAIN}
AWS_ACCESS_KEY_ID: ${env:AWS_ACCESS_KEY_ID}
AWS_SECRET_ACCESS_KEY: ${env:AWS_SECRET_ACCESS_KEY}
production:
SUBDOMAIN: ${env:SUBDOMAIN}.${env:DOMAIN}
BUCKET_NAME: bnb-bank-upload.${env:DOMAIN}
Expand Down Expand Up @@ -64,6 +66,9 @@ functions:
APP_NAME: ${param:APP_NAME}
DB_URI: ${param:DB_URI}
AWS_BUCKET: ${param:BUCKET_NAME}
AWS_REGION: ${param:REGION}
AWS_ACCESS_KEY_ID: ${param:AWS_ACCESS_KEY_ID}
AWS_SECRET_ACCESS_KEY: ${param:AWS_SECRET_ACCESS_KEY}
AWS_USE_PATH_STYLE_ENDPOINT: false
JWT_SECRET: ${param:JWT_SECRET}
events:
Expand Down

0 comments on commit 4238117

Please sign in to comment.