This repository was archived by the owner on Mar 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathserverless.yml
More file actions
79 lines (73 loc) · 2.21 KB
/
serverless.yml
File metadata and controls
79 lines (73 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
service: aws-swift-sprinter-html # NOTE: update this with your service name
package:
individually: true
provider:
name: aws
runtime: provided
memorySize: 192
environment:
PRODUCTS_TABLE_NAME: "${self:custom.productsTableName}"
iamRoleStatements:
- Effect: Allow
Action:
- logs:CreateLogGroup
- logs:CreateLogStream
- logs:PutLogEvents
Resource: "*"
- Effect: Allow
Action:
- dynamodb:UpdateItem
- dynamodb:PutItem
- dynamodb:GetItem
- dynamodb:DeleteItem
- dynamodb:Query
- dynamodb:Scan
- dynamodb:DescribeTable
Resource:
- { Fn::GetAtt: [ProductsTable, Arn] }
layers:
swift-lambda-runtime:
path: ./build/swift-lambda-runtime
name: aws-swift-sprinter-lambda-runtime
description: AWS Lambda Custom Runtime for Swift-Sprinter
custom:
productsTableName: swift-sprinter-products-table-${self:provider.stage}
functions:
hello:
handler: build/Hello.hello
package:
individually: true
exclude:
- "**/*"
include:
- build/Hello
layers:
- { Ref: SwiftDashlambdaDashruntimeLambdaLayer }
events:
- http:
path: hello
method: get
cors: true
integration: lambda-proxy
response:
passThrough: NEVER
- http:
path: hello
method: post
cors: true
integration: lambda-proxy
response:
passThrough: NEVER
resources:
Resources:
ProductsTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: ${self:custom.productsTableName}
AttributeDefinitions:
- AttributeName: sku
AttributeType: S
KeySchema:
- AttributeName: sku
KeyType: HASH
BillingMode: PAY_PER_REQUEST