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.

128 lines
3.4 KiB

4 years ago
4 years ago
4 years ago
4 years ago
  1. service: stufflog2
  2. frameworkVersion: '2'
  3. provider:
  4. name: aws
  5. runtime: go1.x
  6. memorySize: 512
  7. stage: prod
  8. region: ${env:AWS_DEFAULT_REGION}
  9. role: ${env:AMI_ROLE}
  10. tags:
  11. Name: Stufflog2
  12. Type: Application
  13. apiGateway:
  14. shouldStartNameWithService: true
  15. minimumCompressionSize: 2048
  16. versionFunctions: false
  17. environment:
  18. DB_DRIVER: ${env:DB_DRIVER}
  19. DB_CONNECT: ${env:DB_CONNECT}
  20. functions:
  21. handleApiCalls:
  22. handler: ./build/api/handler
  23. package:
  24. include:
  25. - ./build/api/handler
  26. events:
  27. - http:
  28. method: ANY
  29. path: /api/{proxy+}
  30. authorizer:
  31. arn: arn:aws:cognito-idp:eu-north-1:670816140020:userpool/eu-north-1_09uLRfo6H
  32. timeout: 30
  33. package:
  34. individually: true
  35. exclude:
  36. - ./**
  37. plugins:
  38. - serverless-domain-manager
  39. - serverless-apigateway-service-proxy
  40. custom:
  41. webuiBucket: ${env:S3_WEBUI_BUCKET}
  42. apiGatewayServiceProxies:
  43. - s3:
  44. path: /
  45. method: get
  46. action: GetObject
  47. bucket: ${self:custom.webuiBucket}
  48. roleArn: ${self:provider.role}
  49. key: index.html
  50. requestParameters:
  51. 'integration.request.header.cache-control': "'public, max-age=86400, immutable'"
  52. - s3:
  53. path: /goals
  54. method: get
  55. action: GetObject
  56. bucket: ${self:custom.webuiBucket}
  57. roleArn: ${self:provider.role}
  58. key: index.html
  59. requestParameters:
  60. 'integration.request.header.cache-control': "'public, max-age=86400, immutable'"
  61. - s3:
  62. path: /projects
  63. method: get
  64. action: GetObject
  65. bucket: ${self:custom.webuiBucket}
  66. roleArn: ${self:provider.role}
  67. key: index.html
  68. requestParameters:
  69. 'integration.request.header.cache-control': "'public, max-age=86400, immutable'"
  70. - s3:
  71. path: /questlog
  72. method: get
  73. action: GetObject
  74. bucket: ${self:custom.webuiBucket}
  75. roleArn: ${self:provider.role}
  76. key: index.html
  77. requestParameters:
  78. 'integration.request.header.cache-control': "'public, max-age=86400, immutable'"
  79. - s3:
  80. path: /items
  81. method: get
  82. action: GetObject
  83. bucket: ${self:custom.webuiBucket}
  84. roleArn: ${self:provider.role}
  85. key: index.html
  86. requestParameters:
  87. 'integration.request.header.cache-control': "'public, max-age=86400, immutable'"
  88. - s3:
  89. path: /logs
  90. method: get
  91. action: GetObject
  92. bucket: ${self:custom.webuiBucket}
  93. roleArn: ${self:provider.role}
  94. key: index.html
  95. requestParameters:
  96. 'integration.request.header.cache-control': "'public, max-age=86400, immutable'"
  97. - s3:
  98. path: /{myPath+}
  99. method: get
  100. action: GetObject
  101. bucket: ${self:custom.webuiBucket}
  102. roleArn: ${self:provider.role}
  103. requestParameters:
  104. 'integration.request.path.myPath': 'method.request.path.myPath'
  105. 'integration.request.path.object': 'method.request.path.myPath'
  106. 'integration.request.header.cache-control': "'public, max-age=86400, immutable'"
  107. customDomain:
  108. domainName: ${env:DOMAIN_NAME}
  109. basePath: ''
  110. certificateName: ${env:CERTIFICATE_NAME}
  111. certificateArn: ${env:CERTIFICATE_ARN}
  112. createRoute53Record: true
  113. endpointType: 'regional'
  114. hostedZoneId: ${env:HOSTED_ZONE_ID}
  115. autoDomain: true