3 Star 0 Fork 0

mirrors_harijoe / serverless-boilerplate

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
serverless.yml 1.73 KB
一键复制 编辑 原始数据 按行查看 历史
Julien Vallini 提交于 2018-11-20 00:35 . Improve webpack config and readme
# Welcome to Serverless!
#
# This file is the main config file for your service.
# It's very minimal at this point and uses default values.
# You can always add more config options for more control.
# We've included some commented out config examples here.
# Just uncomment any of them to get that config option.
#
# For full config options, check the docs:
# docs.serverless.com
#
# Happy Coding!
service: serviceName
provider:
name: aws
runtime: nodejs8.10
environment: ${file(./env.yml):${opt:stage, self:provider.stage}}
timeout: 30
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:DeleteItem
Resource: "arn:aws:dynamodb:${opt:region, self:provider.region}:*:table/${self:provider.environment.DYNAMODB_TABLE}"
functions:
hello:
handler: src/handlers/hello.default
events:
- http:
path: hello/{path+}
method: get
cors: true
resources:
Resources:
DynamoDbTable:
Type: 'AWS::DynamoDB::Table'
DeletionPolicy: Retain
Properties:
AttributeDefinitions:
-
AttributeName: id
AttributeType: S
KeySchema:
-
AttributeName: id
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
TableName: ${self:provider.environment.DYNAMODB_TABLE}
plugins:
- serverless-webpack
- serverless-dynamodb-local
- serverless-offline
custom:
serverless-offline:
port: 3001
dynamodb:
start:
migrate: true
port: 8000
webpack:
includeModules: true
1
https://gitee.com/mirrors_harijoe/serverless-boilerplate.git
git@gitee.com:mirrors_harijoe/serverless-boilerplate.git
mirrors_harijoe
serverless-boilerplate
serverless-boilerplate
master

搜索帮助