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.

114 lines
2.9 KiB

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: ANY /api/{proxy+}
  28. timeout: 30
  29. package:
  30. individually: true
  31. exclude:
  32. - ./**
  33. plugins:
  34. - serverless-domain-manager
  35. - serverless-apigateway-service-proxy
  36. custom:
  37. webuiBucket: ${env:S3_WEBUI_BUCKET}
  38. apiGatewayServiceProxies:
  39. - s3:
  40. path: /
  41. method: get
  42. action: GetObject
  43. bucket: ${self:custom.webuiBucket}
  44. roleArn: ${self:provider.role}
  45. key: index.html
  46. requestParameters:
  47. 'integration.request.header.cache-control': "'public, max-age=86400, immutable'"
  48. - s3:
  49. path: /goals
  50. method: get
  51. action: GetObject
  52. bucket: ${self:custom.webuiBucket}
  53. roleArn: ${self:provider.role}
  54. key: index.html
  55. requestParameters:
  56. 'integration.request.header.cache-control': "'public, max-age=86400, immutable'"
  57. - s3:
  58. path: /projects
  59. method: get
  60. action: GetObject
  61. bucket: ${self:custom.webuiBucket}
  62. roleArn: ${self:provider.role}
  63. key: index.html
  64. requestParameters:
  65. 'integration.request.header.cache-control': "'public, max-age=86400, immutable'"
  66. - s3:
  67. path: /items
  68. method: get
  69. action: GetObject
  70. bucket: ${self:custom.webuiBucket}
  71. roleArn: ${self:provider.role}
  72. key: index.html
  73. requestParameters:
  74. 'integration.request.header.cache-control': "'public, max-age=86400, immutable'"
  75. - s3:
  76. path: /logs
  77. method: get
  78. action: GetObject
  79. bucket: ${self:custom.webuiBucket}
  80. roleArn: ${self:provider.role}
  81. key: index.html
  82. requestParameters:
  83. 'integration.request.header.cache-control': "'public, max-age=86400, immutable'"
  84. - s3:
  85. path: /{myPath+}
  86. method: get
  87. action: GetObject
  88. bucket: ${self:custom.webuiBucket}
  89. roleArn: ${self:provider.role}
  90. requestParameters:
  91. 'integration.request.path.myPath': 'method.request.path.myPath'
  92. 'integration.request.path.object': 'method.request.path.myPath'
  93. 'integration.request.header.cache-control': "'public, max-age=86400, immutable'"
  94. customDomain:
  95. domainName: ${env:DOMAIN_NAME}
  96. basePath: ''
  97. certificateName: ${env:CERTIFICATE_NAME}
  98. certificateArn: ${env:CERTIFICATE_ARN}
  99. createRoute53Record: true
  100. endpointType: 'regional'
  101. hostedZoneId: ${env:HOSTED_ZONE_ID}
  102. autoDomain: true