forked from lulumeisterr/study-datalake
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackaged.yaml
More file actions
145 lines (144 loc) · 4.02 KB
/
Copy pathpackaged.yaml
File metadata and controls
145 lines (144 loc) · 4.02 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: 'Rest API to manage a Data Lake of trip links
'
Globals:
Function:
Timeout: 50
MemorySize: 512
Environment:
Variables:
TABLE_NAME:
Ref: TripTable
ENDPOINT_OVERRIDE: ''
Resources:
CreateTripRecordFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: s3://bucket-trip/dc2ab4825c7216215c857d00f74ae747
Handler: br.com.iwe.handler.CreateTripRecord::handleRequest
Runtime: java8
Policies:
- DynamoDBCrudPolicy:
TableName:
Ref: TripTable
Events:
CreateTripRecord:
Type: Api
Properties:
Path: /trip
Method: post
GetTripsByCountryFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: s3://bucket-trip/dc2ab4825c7216215c857d00f74ae747
Handler: br.com.iwe.handler.GetTripsByCountry::handleRequest
Runtime: java8
Policies:
- DynamoDBCrudPolicy:
TableName:
Ref: TripTable
Events:
GetTripsByCountry:
Type: Api
Properties:
Path: /trip/country/{country}
Method: get
GetTripsByPeriodFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: s3://bucket-trip/dc2ab4825c7216215c857d00f74ae747
Handler: br.com.iwe.handler.GetTripsByPeriod::handleRequest
Runtime: java8
Policies:
- DynamoDBCrudPolicy:
TableName:
Ref: TripTable
Events:
GetTripsByPeriod:
Type: Api
Properties:
Path: /trip/{country}/period
Method: get
RequestParameters:
- method.request.querystring.start
- method.request.querystring.end
GetByCityFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: s3://bucket-trip/dc2ab4825c7216215c857d00f74ae747
Handler: br.com.iwe.handler.GetTripsByCity::handleRequest
Runtime: java8
Policies:
- DynamoDBCrudPolicy:
TableName:
Ref: TripTable
Events:
CreateTripRecord:
Type: Api
Properties:
Path: /trip/{country}/findByCity
Method: get
RequestParameters:
- method.request.querystring.city
TripTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: trip
AttributeDefinitions:
- AttributeName: country
AttributeType: S
- AttributeName: city
AttributeType: S
- AttributeName: dateTrip
AttributeType: S
- AttributeName: reason
AttributeType: S
KeySchema:
- AttributeName: country
KeyType: HASH
- AttributeName: dateTrip
KeyType: RANGE
LocalSecondaryIndexes:
- IndexName: cityIndex
KeySchema:
- AttributeName: country
KeyType: HASH
- AttributeName: city
KeyType: RANGE
Projection:
ProjectionType: ALL
- IndexName: reasonIndex
KeySchema:
- AttributeName: country
KeyType: HASH
- AttributeName: reason
KeyType: RANGE
Projection:
ProjectionType: ALL
BillingMode: PAY_PER_REQUEST
Outputs:
CreateTripRecordFunction:
Description: CreateTripRecord Lambda Function ARN
Value:
Fn::GetAtt:
- CreateTripRecordFunction
- Arn
GetByCityFunction:
Description: GetByCityFunction Lambda Function ARN
Value:
Fn::GetAtt:
- GetByCityFunction
- Arn
GetTripsByCountryFunction:
Description: GetTripsByCountryFunction Lambda Function ARN
Value:
Fn::GetAtt:
- GetTripsByCountryFunction
- Arn
GetTripsByPeriodFunction:
Description: GetTripsByPeriodFunction Lambda Function ARN
Value:
Fn::GetAtt:
- GetTripsByPeriodFunction
- Arn