Advertisement
war776en

serverless.yml

Feb 24th, 2020
437
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.76 KB | None | 0 0
  1. service: firstApp
  2.  
  3. provider:
  4.   name: aws
  5.   runtime: nodejs12.x
  6.   region: ${opt:region, 'ap-southeast-1'}
  7.   iamRoleStatements:
  8.   - Effect: "Allow"
  9.     Action:
  10.       - "s3:*"
  11.     Resource: "arn:aws:s3:::myapp/*"
  12.  
  13. plugins:
  14.   - serverless-offline
  15.  
  16.  
  17. functions:
  18.   hello:
  19.     handler: handler.hello
  20.     events:
  21.       - http: ANY {proxy+}
  22.           cors: true
  23.  
  24. resources:
  25.   Resources:
  26.     UploadBucket:
  27.       Type: AWS::S3::Bucket
  28.       Properties:
  29.         BucketName: myapp
  30.         AccessControl: PublicRead
  31.         CorsConfiguration:
  32.           CorsRules:
  33.           - AllowedMethods:
  34.             - GET
  35.             - PUT
  36.             - POST
  37.             - HEAD
  38.             AllowedOrigins:
  39.             - "*"
  40.             AllowedHeaders:
  41.             - "*"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement