Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Serverless deploy #805

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
2 changes: 1 addition & 1 deletion serverless-aws/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"@redwoodjs/api": "5.0.4-next.41",
"@redwoodjs/auth-dbauth-api": "5.0.4-next.41",
"@redwoodjs/graphql-server": "5.0.4-next.41",
"serverless": "3.3.0"
"serverless": "3.30.1"
}
}
18 changes: 17 additions & 1 deletion serverless-aws/api/serverless.yml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok to try this for testing. But to confirm we have CORS working, we'll need to be able to deploy this with the original setting.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ provider:
httpApi: # HTTP API is used by default. To learn about the available options in API Gateway, see https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-vs-rest.html
cors:
allowedOrigins:
- 'https://d3j2lmbogvczkg.cloudfront.net' # This is the default value. You can remove this line if you want to restrict the CORS to a specific origin.
- 'https://*' # This is the default value. You can remove this line if you want to restrict the CORS to a specific origin.
allowCredentials: true # allowCrednetials should only be used when allowedOrigins doesn't include '*'
allowedHeaders:
- authorization
Expand Down Expand Up @@ -67,4 +67,20 @@ functions:
- httpApi:
path: /graphql
method: POST
auth:
description: auth function deployed on AWS Lambda
package:
artifact: dist/zipball/auth.zip
memorySize: 1024 # in megabytes
timeout: 25 # seconds (max: 900 [15 minutes])
tags: # tags for this specific lambda function
endpoint: /auth
handler: auth.handler
events:
- httpApi: # if a function should be limited to only GET or POST you can remove one or the other here
path: /auth
method: GET
- httpApi:
path: /auth
method: POST

8 changes: 4 additions & 4 deletions serverless-aws/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
},
"devDependencies": {
"@redwoodjs/core": "5.0.4-next.41",
"@vercel/nft": "0.17.5",
"archiver": "5.3.0",
"@vercel/nft": "0.22.6",
"archiver": "5.3.1",
"fs-extra": "10.0.0",
"serverless": "3.3.0",
"serverless-lift": "1.12.1"
"serverless": "3.30.1",
"serverless-lift": "1.25.1"
},
"eslintConfig": {
"extends": "@redwoodjs/eslint-config",
Expand Down
2 changes: 1 addition & 1 deletion serverless-aws/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"prop-types": "15.8.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"serverless": "3.3.0"
"serverless": "3.30.1"
},
"devDependencies": {
"autoprefixer": "10.4.14",
Expand Down
9 changes: 9 additions & 0 deletions serverless-aws/web/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ constructs:
web:
type: static-website
path: dist
extensions: {
bucket: {
Properties: {
PublicAccessBlockConfiguration: {
BlockPublicPolicy: false,
}
}
}
}

provider:
name: aws
Expand Down
Loading