serverless.yml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. service: hnw-wallpad-etl
  2. plugins:
  3. - serverless-python-requirements
  4. provider:
  5. name: aws
  6. runtime: python3.8
  7. lambdaHashingVersion: 20201221
  8. # you can overwrite defaults here
  9. stage: dev
  10. region: ap-northeast-2
  11. memorySize: 1024
  12. timeout: 180
  13. # you can add statements to the Lambda function's IAM Role here
  14. iamRoleStatements:
  15. - Effect: "Allow"
  16. Action:
  17. - "s3:ListBucket"
  18. - "s3:GetObject"
  19. Resource:
  20. - "arn:aws:s3:::homenetwork-data/*"
  21. - Effect: "Allow"
  22. Action:
  23. - "s3:PutObject"
  24. Resource:
  25. - "arn:aws:s3:::hdci-wallpad-prep/*"
  26. # you can define service wide environment variables here
  27. environment:
  28. PREP_BUCKET: hdci-wallpad-prep
  29. # you can add packaging information here
  30. package:
  31. individually: true
  32. exclude:
  33. - "**/requirements.txt"
  34. - "venv/**"
  35. custom:
  36. UPLOAD_BUCKET: ${self:custom.bucket}
  37. bucket: ${self:service}-${self:provider.stage}
  38. pythonRequirements:
  39. slim: true
  40. useStaticCache: true
  41. useDownloadCache: true
  42. cacheLocation: './._cache'
  43. staticCacheMaxVersions: 10
  44. noDeploy:
  45. - pip
  46. - setuptools
  47. - boto3
  48. - botocore
  49. - dateutil
  50. - docutils
  51. - jmespath
  52. - python_dateutil
  53. - s3transfer
  54. - six
  55. - urllib3
  56. dockerizePip: non-linux
  57. functions:
  58. prep-f:
  59. handler: preprocess/lambda_function.lambda_handler
  60. module: preprocess
  61. name: hdci-wallpad-raw-to-prep
  62. events:
  63. - s3:
  64. bucket: homenetwork-data
  65. event: s3:ObjectCreated:*
  66. existing: true