You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
119 lines
3.1 KiB
119 lines
3.1 KiB
service: stufflog2
|
|
|
|
frameworkVersion: '2'
|
|
|
|
provider:
|
|
name: aws
|
|
runtime: go1.x
|
|
memorySize: 512
|
|
stage: prod
|
|
region: ${env:AWS_DEFAULT_REGION}
|
|
role: ${env:AMI_ROLE}
|
|
tags:
|
|
Name: Stufflog2
|
|
Type: Application
|
|
apiGateway:
|
|
shouldStartNameWithService: true
|
|
minimumCompressionSize: 2048
|
|
versionFunctions: false
|
|
environment:
|
|
DB_DRIVER: ${env:DB_DRIVER}
|
|
DB_CONNECT: ${env:DB_CONNECT}
|
|
|
|
functions:
|
|
handleApiCalls:
|
|
handler: ./build/api/handler
|
|
package:
|
|
include:
|
|
- ./build/api/handler
|
|
events:
|
|
- http:
|
|
method: ANY
|
|
path: /api/{proxy+}
|
|
authorizer:
|
|
arn: arn:aws:cognito-idp:eu-north-1:670816140020:userpool/eu-north-1_09uLRfo6H
|
|
timeout: 30
|
|
|
|
package:
|
|
individually: true
|
|
exclude:
|
|
- ./**
|
|
|
|
plugins:
|
|
- serverless-domain-manager
|
|
- serverless-apigateway-service-proxy
|
|
|
|
custom:
|
|
webuiBucket: ${env:S3_WEBUI_BUCKET}
|
|
|
|
apiGatewayServiceProxies:
|
|
- s3:
|
|
path: /
|
|
method: get
|
|
action: GetObject
|
|
bucket: ${self:custom.webuiBucket}
|
|
roleArn: ${self:provider.role}
|
|
key: index.html
|
|
requestParameters:
|
|
'integration.request.header.cache-control': "'public, max-age=86400, immutable'"
|
|
|
|
- s3:
|
|
path: /goals
|
|
method: get
|
|
action: GetObject
|
|
bucket: ${self:custom.webuiBucket}
|
|
roleArn: ${self:provider.role}
|
|
key: index.html
|
|
requestParameters:
|
|
'integration.request.header.cache-control': "'public, max-age=86400, immutable'"
|
|
|
|
- s3:
|
|
path: /projects
|
|
method: get
|
|
action: GetObject
|
|
bucket: ${self:custom.webuiBucket}
|
|
roleArn: ${self:provider.role}
|
|
key: index.html
|
|
requestParameters:
|
|
'integration.request.header.cache-control': "'public, max-age=86400, immutable'"
|
|
|
|
- s3:
|
|
path: /items
|
|
method: get
|
|
action: GetObject
|
|
bucket: ${self:custom.webuiBucket}
|
|
roleArn: ${self:provider.role}
|
|
key: index.html
|
|
requestParameters:
|
|
'integration.request.header.cache-control': "'public, max-age=86400, immutable'"
|
|
|
|
- s3:
|
|
path: /logs
|
|
method: get
|
|
action: GetObject
|
|
bucket: ${self:custom.webuiBucket}
|
|
roleArn: ${self:provider.role}
|
|
key: index.html
|
|
requestParameters:
|
|
'integration.request.header.cache-control': "'public, max-age=86400, immutable'"
|
|
|
|
- s3:
|
|
path: /{myPath+}
|
|
method: get
|
|
action: GetObject
|
|
bucket: ${self:custom.webuiBucket}
|
|
roleArn: ${self:provider.role}
|
|
requestParameters:
|
|
'integration.request.path.myPath': 'method.request.path.myPath'
|
|
'integration.request.path.object': 'method.request.path.myPath'
|
|
'integration.request.header.cache-control': "'public, max-age=86400, immutable'"
|
|
|
|
customDomain:
|
|
domainName: ${env:DOMAIN_NAME}
|
|
basePath: ''
|
|
certificateName: ${env:CERTIFICATE_NAME}
|
|
certificateArn: ${env:CERTIFICATE_ARN}
|
|
createRoute53Record: true
|
|
endpointType: 'regional'
|
|
hostedZoneId: ${env:HOSTED_ZONE_ID}
|
|
autoDomain: true
|