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.

151 lines
4.0 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/{pid}
  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: /questlog/{gid}/{pid}
  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: /questlog
  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: /items
  99. method: get
  100. action: GetObject
  101. bucket: ${self:custom.webuiBucket}
  102. roleArn: ${self:provider.role}
  103. key: index.html
  104. requestParameters:
  105. 'integration.request.header.cache-control': "'public, max-age=86400, immutable'"
  106. - s3:
  107. path: /logs
  108. method: get
  109. action: GetObject
  110. bucket: ${self:custom.webuiBucket}
  111. roleArn: ${self:provider.role}
  112. key: index.html
  113. requestParameters:
  114. 'integration.request.header.cache-control': "'public, max-age=86400, immutable'"
  115. - s3:
  116. path: /{myPath+}
  117. method: get
  118. action: GetObject
  119. bucket: ${self:custom.webuiBucket}
  120. roleArn: ${self:provider.role}
  121. requestParameters:
  122. 'integration.request.path.myPath': 'method.request.path.myPath'
  123. 'integration.request.path.object': 'method.request.path.myPath'
  124. 'integration.request.header.cache-control': "'public, max-age=86400, immutable'"
  125. customDomain:
  126. domainName: ${env:DOMAIN_NAME}
  127. basePath: ''
  128. certificateName: ${env:CERTIFICATE_NAME}
  129. certificateArn: ${env:CERTIFICATE_ARN}
  130. createRoute53Record: true
  131. endpointType: 'regional'
  132. hostedZoneId: ${env:HOSTED_ZONE_ID}
  133. autoDomain: true