serverless.yml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. service: ambt-anoicos
  2. frameworkVersion: '2'
  3. provider:
  4. name: aws
  5. runtime: python3.8
  6. lambdaHashingVersion: 20201221
  7. stage: dev
  8. region: ap-northeast-2
  9. # you can add statements to the Lambda function's IAM Role here
  10. # iamRoleStatements:
  11. # - Effect: "Allow"
  12. # Action:
  13. # - "s3:ListBucket"
  14. # Resource: { "Fn::Join" : ["", ["arn:aws:s3:::", { "Ref" : "ServerlessDeploymentBucket" } ] ] }
  15. # - Effect: "Allow"
  16. # Action:
  17. # - "s3:PutObject"
  18. # Resource:
  19. # Fn::Join:
  20. # - ""
  21. # - - "arn:aws:s3:::"
  22. # - "Ref" : "ServerlessDeploymentBucket"
  23. # - "/*"
  24. # you can define service wide environment variables here
  25. # environment:
  26. # variable1: value1
  27. # you can add packaging information here
  28. #package:
  29. # patterns:
  30. # - '!exclude-me.py'
  31. # - '!exclude-me-dir/**'
  32. # - include-me.py
  33. # - include-me-dir/**
  34. functions:
  35. numpy:
  36. handler: handler.main
  37. layers:
  38. - Ref: PythonRequirementsLambdaLayer
  39. # The following are a few example events you can configure
  40. # NOTE: Please make sure to change your handler code to work with those events
  41. # Check the event documentation for details
  42. # events:
  43. # - httpApi:
  44. # path: /users/create
  45. # method: get
  46. # - websocket: $connect
  47. # - s3: ${env:BUCKET}
  48. # - schedule: rate(10 minutes)
  49. # - sns: greeter-topic
  50. # - stream: arn:aws:dynamodb:region:XXXXXX:table/foo/stream/1970-01-01T00:00:00.000
  51. # - alexaSkill: amzn1.ask.skill.xx-xx-xx-xx
  52. # - alexaSmartHome: amzn1.ask.skill.xx-xx-xx-xx
  53. # - iot:
  54. # sql: "SELECT * FROM 'some_topic'"
  55. # - cloudwatchEvent:
  56. # event:
  57. # source:
  58. # - "aws.ec2"
  59. # detail-type:
  60. # - "EC2 Instance State-change Notification"
  61. # detail:
  62. # state:
  63. # - pending
  64. # - cloudwatchLog: '/aws/lambda/hello'
  65. # - cognitoUserPool:
  66. # pool: MyUserPool
  67. # trigger: PreSignUp
  68. # - alb:
  69. # listenerArn: arn:aws:elasticloadbalancing:us-east-1:XXXXXX:listener/app/my-load-balancer/50dc6c495c0c9188/
  70. # priority: 1
  71. # conditions:
  72. # host: example.com
  73. # path: /hello
  74. # Define function environment variables here
  75. # environment:
  76. # variable2: value2
  77. # you can add CloudFormation resource templates here
  78. #resources:
  79. # Resources:
  80. # NewResource:
  81. # Type: AWS::S3::Bucket
  82. # Properties:
  83. # BucketName: my-new-bucket
  84. # Outputs:
  85. # NewOutput:
  86. # Description: "Description for the output"
  87. # Value: "Some output value"
  88. plugins:
  89. - serverless-python-requirements
  90. custom:
  91. pythonRequirements:
  92. dockerizePip: non-linux
  93. slim: true
  94. layer: true
  95. noDeploy:
  96. - pip
  97. - setuptool
  98. - boto3
  99. - botocore
  100. - jmespath
  101. - s3transfer
  102. - dateutil
  103. - docutils
  104. - python_dateutil
  105. - six
  106. - urllib3