Loggest thine Stuff
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.

96 lines
2.8 KiB

  1. service: stufflog3
  2. frameworkVersion: '3'
  3. provider:
  4. name: aws
  5. runtime: go1.x
  6. memorySize: 512
  7. stage: prod
  8. region: ${env:STUFFLOG3_AWS_REGION}
  9. tags:
  10. Name: Stufflog3
  11. Type: Application
  12. apiGateway:
  13. shouldStartNameWithService: true
  14. minimumCompressionSize: 2048
  15. versionFunctions: false
  16. environment:
  17. STUFFLOG3_AWS_CLIENT_ID: ${env:STUFFLOG3_AWS_CLIENT_ID}
  18. STUFFLOG3_AWS_CLIENT_SECRET: ${env:STUFFLOG3_AWS_CLIENT_SECRET}
  19. STUFFLOG3_AWS_POOL_CLIENT_ID: ${env:STUFFLOG3_AWS_POOL_CLIENT_ID}
  20. STUFFLOG3_AWS_POOL_CLIENT_SECRET: ${env:STUFFLOG3_AWS_POOL_CLIENT_SECRET}
  21. STUFFLOG3_AWS_POOL_ID: ${env:STUFFLOG3_AWS_POOL_ID}
  22. STUFFLOG3_AWS_REGION: ${env:STUFFLOG3_AWS_REGION}
  23. STUFFLOG3_MYSQL_HOST: ${env:STUFFLOG3_MYSQL_HOST}
  24. STUFFLOG3_MYSQL_PASSWORD: ${env:STUFFLOG3_MYSQL_PASSWORD}
  25. STUFFLOG3_MYSQL_PORT: ${env:STUFFLOG3_MYSQL_PORT}
  26. STUFFLOG3_MYSQL_SCHEMA: ${env:STUFFLOG3_MYSQL_SCHEMA}
  27. STUFFLOG3_MYSQL_USERNAME: ${env:STUFFLOG3_MYSQL_USERNAME}
  28. functions:
  29. handleApi:
  30. runtime: go1.x
  31. handler: ./build/handler
  32. package:
  33. include:
  34. - ./build/handler
  35. events:
  36. - http:
  37. method: ANY
  38. path: /api/{proxy+}
  39. timeout: 30
  40. package:
  41. individually: true
  42. exclude:
  43. - ./**
  44. plugins:
  45. - serverless-domain-manager
  46. - serverless-apigateway-service-proxy
  47. custom:
  48. webuiBucket: ${env:S3_WEBUI_BUCKET}
  49. apiGatewayServiceProxies:
  50. - s3:
  51. path: /_app/{myPath+}
  52. method: get
  53. action: GetObject
  54. bucket: ${self:custom.webuiBucket}
  55. roleArn: ${self:provider.role}
  56. requestParameters:
  57. 'integration.request.path.myPath': 'method.request.path.myPath'
  58. 'integration.request.path.object': 'method.request.path.myPath'
  59. 'integration.request.header.cache-control': "'public, max-age=86400, immutable'"
  60. - s3:
  61. path: /favicon.png
  62. method: get
  63. action: GetObject
  64. bucket: ${self:custom.webuiBucket}
  65. roleArn: ${self:provider.role}
  66. key: favicon.png
  67. requestParameters:
  68. 'integration.request.path.myPath': 'method.request.path.myPath'
  69. 'integration.request.path.object': 'method.request.path.myPath'
  70. 'integration.request.header.cache-control': "'public, max-age=86400, immutable'"
  71. - s3:
  72. path: /{myPath+}
  73. method: get
  74. action: GetObject
  75. bucket: ${self:custom.webuiBucket}
  76. roleArn: ${self:provider.role}
  77. key: index.html
  78. requestParameters:
  79. 'integration.request.header.cache-control': "'public, max-age=86400, immutable'"
  80. customDomain:
  81. domainName: ${env:DOMAIN_NAME}
  82. basePath: ''
  83. certificateName: ${env:CERTIFICATE_NAME}
  84. certificateArn: ${env:CERTIFICATE_ARN}
  85. createRoute53Record: true
  86. endpointType: 'regional'
  87. hostedZoneId: ${env:HOSTED_ZONE_ID}
  88. autoDomain: true