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.

118 lines
3.1 KiB

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: /items
  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: /logs
  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: /{myPath+}
  90. method: get
  91. action: GetObject
  92. bucket: ${self:custom.webuiBucket}
  93. roleArn: ${self:provider.role}
  94. requestParameters:
  95. 'integration.request.path.myPath': 'method.request.path.myPath'
  96. 'integration.request.path.object': 'method.request.path.myPath'
  97. 'integration.request.header.cache-control': "'public, max-age=86400, immutable'"
  98. customDomain:
  99. domainName: ${env:DOMAIN_NAME}
  100. basePath: ''
  101. certificateName: ${env:CERTIFICATE_NAME}
  102. certificateArn: ${env:CERTIFICATE_ARN}
  103. createRoute53Record: true
  104. endpointType: 'regional'
  105. hostedZoneId: ${env:HOSTED_ZONE_ID}
  106. autoDomain: true