-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
101 lines (98 loc) · 2.61 KB
/
serverless.yml
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
service: xref-service-${opt:type, self:custom.defaultType}
custom:
defaultType: generic
defaultStage: dev
profiles:
dev: default
test: ecommtest
provider:
name: aws
runtime: python2.7
stage: ${opt:stage, self:custom.defaultStage}
profile: ${self:custom.profiles.${self:provider.stage}}
region: eu-west-1
timeout: 30
environment:
DYNAMODB_TABLE: ${self:service}-${opt:stage, self:provider.stage}-${opt:type, self:custom.defaultType}
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:DescribeTable
- 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}*
package:
exclude:
- env/**
- test/**
functions:
get_ids:
handler: handler.get_ids
events:
- http:
path: ${self:service}/{system1}/{system1_id}
method: get
new_global_id:
handler: handler.new_global_id
events:
- http:
path: ${self:service}/global/
method: post
link_system_ids:
handler: handler.link_system_ids
events:
- http:
path: ${self:service}/{system1}/{system1_id}/{system2}/{system2_id}
method: put
delete_id:
handler: handler.delete_id
events:
- http:
path: ${self:service}/{system1}/{system1_id}
method: delete
resources:
Resources:
XrefServiceDynamoDbTable:
Type: 'AWS::DynamoDB::Table'
Properties:
AttributeDefinitions:
-
AttributeName: global
AttributeType: S
-
AttributeName: m3
AttributeType: S
-
AttributeName: tp
AttributeType: S
KeySchema:
-
AttributeName: global
KeyType: HASH
GlobalSecondaryIndexes:
- IndexName: m3_system
KeySchema:
- AttributeName: m3
KeyType: HASH
Projection:
ProjectionType: ALL
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
- IndexName: tp_system
KeySchema:
- AttributeName: tp
KeyType: HASH
Projection:
ProjectionType: ALL
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
TableName: ${self:provider.environment.DYNAMODB_TABLE}