I’m trying to get a simple architecture working:
request: https://ndd.tld/api/anything
=> Route 53
=> API Gateway
=> Lambda proxy, one function to manage the entire micro api
request : https://ndd.tld/anything-else
=> Route 53
=> API Gateway
=> S3 bucket (if 404, the index.html, else, the file just found)
The lambda part is working fine, but not the static files. I have this serverless.yml:
service: my-service
provider:
name: aws
runtime: nodejs12.x
stage: dev
region: eu-west-3
custom:
serverless-offline:
port: 3030
printOutput: true
apiGatewayServiceProxies:
- s3:
path: /s3/{folder}/{file}
method: get
action: GetObject
bucket:
Ref: S3Bucket
cors: true
resources:
Resources:
S3Bucket:
Type: 'AWS::S3::Bucket'
functions:
api-handler:
handler: api/index.handler
events:
- http:
path: api/{proxy+}
method: ANY
cors: true
plugins:
- serverless-dotenv-plugin
- serverless-plugin-typescript
- serverless-apigateway-service-proxy
- serverless-offline
I get this error child "s3" fails because ["s3" must be an object]