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.

110 lines
3.2 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  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. role: ${env:IAM_ROLE}
  10. tags:
  11. Name: Stufflog3
  12. Type: Application
  13. apiGateway:
  14. shouldStartNameWithService: true
  15. minimumCompressionSize: 2048
  16. binaryMediaTypes:
  17. - 'image/jpeg'
  18. - 'image/png'
  19. - 'image/*'
  20. versionFunctions: false
  21. environment:
  22. STUFFLOG3_AWS_CLIENT_ID: ${env:STUFFLOG3_AWS_CLIENT_ID}
  23. STUFFLOG3_AWS_CLIENT_SECRET: ${env:STUFFLOG3_AWS_CLIENT_SECRET}
  24. STUFFLOG3_AWS_POOL_CLIENT_ID: ${env:STUFFLOG3_AWS_POOL_CLIENT_ID}
  25. STUFFLOG3_AWS_POOL_CLIENT_SECRET: ${env:STUFFLOG3_AWS_POOL_CLIENT_SECRET}
  26. STUFFLOG3_AWS_POOL_ID: ${env:STUFFLOG3_AWS_POOL_ID}
  27. STUFFLOG3_AWS_REGION: ${env:STUFFLOG3_AWS_REGION}
  28. STUFFLOG3_MYSQL_HOST: ${env:STUFFLOG3_MYSQL_HOST}
  29. STUFFLOG3_MYSQL_PASSWORD: ${env:STUFFLOG3_MYSQL_PASSWORD}
  30. STUFFLOG3_MYSQL_PORT: ${env:STUFFLOG3_MYSQL_PORT}
  31. STUFFLOG3_MYSQL_SCHEMA: ${env:STUFFLOG3_MYSQL_SCHEMA}
  32. STUFFLOG3_MYSQL_USERNAME: ${env:STUFFLOG3_MYSQL_USERNAME}
  33. functions:
  34. handleApi:
  35. runtime: go1.x
  36. handler: ./build/handler
  37. package:
  38. include:
  39. - ./build/handler
  40. events:
  41. - http:
  42. method: ANY
  43. path: /api/{proxy+}
  44. timeout: 15
  45. package:
  46. individually: true
  47. exclude:
  48. - ./**
  49. plugins:
  50. - serverless-domain-manager
  51. - serverless-apigateway-service-proxy
  52. custom:
  53. webuiBucket: ${env:S3_WEBUI_BUCKET}
  54. apiGatewayServiceProxies:
  55. - s3:
  56. path: /_app/{myPath+}
  57. method: get
  58. action: GetObject
  59. bucket: ${self:custom.webuiBucket}
  60. pathOverride: '_app/{myPath}'
  61. roleArn: ${self:provider.role}
  62. requestParameters:
  63. 'integration.request.path.myPath': 'method.request.path.myPath'
  64. 'integration.request.path.object': 'method.request.path.myPath'
  65. 'integration.request.header.cache-control': "'public, max-age=86400, immutable'"
  66. - s3:
  67. path: /favicon.png
  68. method: get
  69. action: GetObject
  70. bucket: ${self:custom.webuiBucket}
  71. roleArn: ${self:provider.role}
  72. requestParameters:
  73. 'integration.request.path.myPath': 'method.request.path.myPath'
  74. 'integration.request.path.object': 'method.request.path.myPath'
  75. 'integration.request.header.cache-control': "'public, max-age=86400, immutable'"
  76. - s3:
  77. path: /
  78. method: get
  79. action: GetObject
  80. bucket: ${self:custom.webuiBucket}
  81. roleArn: ${self:provider.role}
  82. key: index.html
  83. requestParameters:
  84. 'integration.request.header.cache-control': "'public, max-age=86400, immutable'"
  85. - s3:
  86. path: /{myPath+}
  87. method: get
  88. action: GetObject
  89. bucket: ${self:custom.webuiBucket}
  90. roleArn: ${self:provider.role}
  91. key: index.html
  92. requestParameters:
  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