|
| 1 | +# Welcome to Serverless! |
| 2 | +# |
| 3 | +# This file is the main config file for your service. |
| 4 | +# It's very minimal at this point and uses default values. |
| 5 | +# You can always add more config options for more control. |
| 6 | +# We've included some commented out config examples here. |
| 7 | +# Just uncomment any of them to get that config option. |
| 8 | +# |
| 9 | +# For full config options, check the docs: |
| 10 | +# docs.serverless.com |
| 11 | +# |
| 12 | +# Happy Coding! |
| 13 | + |
| 14 | +service: aws-nodejs8-koa |
| 15 | + |
| 16 | +# You can pin your service to only deploy with a specific Serverless version |
| 17 | +# Check out our docs for more details |
| 18 | +# frameworkVersion: "=X.X.X" |
| 19 | + |
| 20 | +# The plugins need to be ordered as follows. |
| 21 | +plugins: |
| 22 | + - serverless-webpack |
| 23 | +# Uncomment to add local dynamodb support |
| 24 | +# - serverless-dynamodb-local |
| 25 | + - serverless-offline |
| 26 | + |
| 27 | +custom: |
| 28 | + webpack: |
| 29 | + includeModules: |
| 30 | + forceExclude: |
| 31 | + - aws-sdk |
| 32 | + packager: 'yarn' # Packager that will be used to package your external modules |
| 33 | +# dynamodb: |
| 34 | +# start: |
| 35 | +# migrate: true |
| 36 | +# seed: false |
| 37 | + serverless-offline: |
| 38 | + #httpsProtocol: "dev-certs" |
| 39 | + #port: 4000 |
| 40 | + |
| 41 | +provider: |
| 42 | + name: aws |
| 43 | + runtime: nodejs8.10 |
| 44 | + |
| 45 | +# you can overwrite defaults here |
| 46 | +# stage: dev |
| 47 | +# region: us-east-1 |
| 48 | + |
| 49 | +# you can add statements to the Lambda function's IAM Role here |
| 50 | +# iamRoleStatements: |
| 51 | +# - Effect: "Allow" |
| 52 | +# Action: |
| 53 | +# - "s3:ListBucket" |
| 54 | +# Resource: { "Fn::Join" : ["", ["arn:aws:s3:::", { "Ref" : "ServerlessDeploymentBucket" } ] ] } |
| 55 | +# - Effect: "Allow" |
| 56 | +# Action: |
| 57 | +# - "s3:PutObject" |
| 58 | +# Resource: |
| 59 | +# Fn::Join: |
| 60 | +# - "" |
| 61 | +# - - "arn:aws:s3:::" |
| 62 | +# - "Ref" : "ServerlessDeploymentBucket" |
| 63 | +# - "/*" |
| 64 | + |
| 65 | +# you can define service wide environment variables here |
| 66 | +# environment: |
| 67 | +# variable1: value1 |
| 68 | + |
| 69 | +# you can add packaging information here |
| 70 | +#package: |
| 71 | +# include: |
| 72 | +# - include-me.js |
| 73 | +# - include-me-dir/** |
| 74 | +# exclude: |
| 75 | +# - exclude-me.js |
| 76 | +# - exclude-me-dir/** |
| 77 | + |
| 78 | +functions: |
| 79 | + hello: |
| 80 | + handler: src/handler.server |
| 81 | + events: |
| 82 | + - http: |
| 83 | + path: / # this matches the base path |
| 84 | + method: ANY |
| 85 | + cors: true |
| 86 | + - http: |
| 87 | + path: /{any+} # this matches any path, the token 'any' doesn't mean anything special |
| 88 | + method: ANY |
| 89 | + cors: true |
| 90 | + |
| 91 | +# The following are a few example events you can configure |
| 92 | +# NOTE: Please make sure to change your handler code to work with those events |
| 93 | +# Check the event documentation for details |
| 94 | +# events: |
| 95 | +# - http: |
| 96 | +# path: users/create |
| 97 | +# method: get |
| 98 | +# - s3: ${env:BUCKET} |
| 99 | +# - schedule: rate(10 minutes) |
| 100 | +# - sns: greeter-topic |
| 101 | +# - stream: arn:aws:dynamodb:region:XXXXXX:table/foo/stream/1970-01-01T00:00:00.000 |
| 102 | +# - alexaSkill: amzn1.ask.skill.xx-xx-xx-xx |
| 103 | +# - alexaSmartHome: amzn1.ask.skill.xx-xx-xx-xx |
| 104 | +# - iot: |
| 105 | +# sql: "SELECT * FROM 'some_topic'" |
| 106 | +# - cloudwatchEvent: |
| 107 | +# event: |
| 108 | +# source: |
| 109 | +# - "aws.ec2" |
| 110 | +# detail-type: |
| 111 | +# - "EC2 Instance State-change Notification" |
| 112 | +# detail: |
| 113 | +# state: |
| 114 | +# - pending |
| 115 | +# - cloudwatchLog: '/aws/lambda/hello' |
| 116 | +# - cognitoUserPool: |
| 117 | +# pool: MyUserPool |
| 118 | +# trigger: PreSignUp |
| 119 | + |
| 120 | +# Define function environment variables here |
| 121 | +# environment: |
| 122 | +# variable2: value2 |
| 123 | + |
| 124 | +# You can add CloudFormation resource templates here |
| 125 | +#resources: |
| 126 | +# Resources: |
| 127 | +# yourDynamoDbTable: |
| 128 | +# Type: AWS::DynamoDB::Table |
| 129 | +# Properties: |
| 130 | +# TableName: YourDynamoDbTable |
| 131 | +# AttributeDefinitions: |
| 132 | +# - AttributeName: id |
| 133 | +# AttributeType: S |
| 134 | +# KeySchema: |
| 135 | +# - AttributeName: id |
| 136 | +# KeyType: HASH |
| 137 | +# ProvisionedThroughput: |
| 138 | +# ReadCapacityUnits: 5 |
| 139 | +# WriteCapacityUnits: 5 |
| 140 | +# NewResource: |
| 141 | +# Type: AWS::S3::Bucket |
| 142 | +# Properties: |
| 143 | +# BucketName: my-new-bucket |
| 144 | +# Outputs: |
| 145 | +# NewOutput: |
| 146 | +# Description: "Description for the output" |
| 147 | +# Value: "Some output value" |
0 commit comments