-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackaged-dev.yaml
172 lines (172 loc) · 4.81 KB
/
packaged-dev.yaml
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
AWSTemplateFormatVersion: '2010-09-09'
Description: NFWF Web Tool REST API
Globals:
Function:
Environment:
Variables:
CONFIG_FILE_DEV: config-dev.yml
CONFIG_FILE_PROD: config-prod.yml
VRT_FILE_DEV: ALL_DATASETS_CONUS_DEV.vrt
VRT_FILE_PROD: ALL_DATASETS_CONUS_PROD.vrt
Outputs:
IdentifyApigwURL:
Description: API Gateway endpoint URL for Identify Function
Value:
Fn::Sub: https://${ApiGatewayApi}.execute-api.${AWS::Region}.amazonaws.com/${Stage}/identify
IdentifyFunction:
Description: Identify Function ARN
Value:
Fn::GetAtt:
- IdentifyFunction
- Arn
UploadShapeApigwURL:
Description: API Gateway endpoint URL for Upload Shape Function
Value:
Fn::Sub: https://${ApiGatewayApi}.execute-api.${AWS::Region}.amazonaws.com/${Stage}/upload_shape
UploadShapeFunction:
Description: Upload Shape Function ARN
Value:
Fn::GetAtt:
- UploadShapeFunction
- Arn
ZonalStatsApigwURL:
Description: API Gateway endpoint URL for Zonal Stats Function
Value:
Fn::Sub: https://${ApiGatewayApi}.execute-api.${AWS::Region}.amazonaws.com/${Stage}/zonal_stats
ZonalStatsFunction:
Description: Identify Function ARN
Value:
Fn::GetAtt:
- ZonalStatsFunction
- Arn
Parameters:
Stage:
Type: String
Resources:
ApiGatewayApi:
Properties:
Cors: '''*'''
DefinitionBody:
basePath: /
definitions:
Empty:
title: Empty Schema
type: object
info:
title:
Fn::Sub: NFWF Tool (${Stage})
paths:
/identify:
get:
produces:
- application/json
responses: {}
x-amazon-apigateway-integration:
httpMethod: POST
type: aws_proxy
uri:
Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${IdentifyFunction.Arn}/invocations
/upload_shape:
post:
produces:
- application/json
responses: {}
x-amazon-apigateway-integration:
httpMethod: POST
type: aws_proxy
uri:
Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${UploadShapeFunction.Arn}/invocations
/zonal_stats:
post:
produces:
- application/json
responses: {}
x-amazon-apigateway-integration:
httpMethod: POST
type: aws_proxy
uri:
Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${ZonalStatsFunction.Arn}/invocations
schemes:
- https
swagger: 2.0
StageName:
Ref: Stage
Type: AWS::Serverless::Api
IdentifyFunction:
Properties:
CodeUri: s3://nemac-cloudformation/57db2c3845d60166e17577c84524cf69
Events:
GetApi:
Properties:
Method: GET
Path: /identify
RestApiId:
Ref: ApiGatewayApi
Type: Api
Handler: app.lambda_handler
MemorySize: 512
Policies:
- AmazonS3ReadOnlyAccess
- IAMReadOnlyAccess
Runtime: python3.6
Tags:
AppFunction: Identify
AppName: NfwfToolRestApi
Client: NFWF
Project: NfwfTool
Stage:
Ref: Stage
Timeout: 300
Type: AWS::Serverless::Function
UploadShapeFunction:
Properties:
CodeUri: s3://nemac-cloudformation/67e78cb9d94cdc6eade6abb9ceb85691
Events:
PostApi:
Properties:
Method: POST
Path: /upload_shape
RestApiId:
Ref: ApiGatewayApi
Type: Api
Handler: app.lambda_handler
Policies:
- IAMReadOnlyAccess
- AmazonS3FullAccess
Runtime: python3.6
Tags:
AppFunction: UploadShape
AppName: NfwfToolApi
Client: NFWF
Project: NfwfTool
Stage:
Ref: Stage
Timeout: 200
Type: AWS::Serverless::Function
ZonalStatsFunction:
Properties:
CodeUri: s3://nemac-cloudformation/4188421096805f41ec0edc9ba567476b
Events:
PostApi:
Properties:
Method: POST
Path: /zonal_stats
RestApiId:
Ref: ApiGatewayApi
Type: Api
Handler: app.lambda_handler
MemorySize: 2048
Policies:
- AmazonS3ReadOnlyAccess
- IAMReadOnlyAccess
Runtime: python3.6
Tags:
AppFunction: ZonalStats
AppName: NfwfToolApi
Client: NFWF
Project: NfwfTool
Stage:
Ref: Stage
Timeout: 900
Type: AWS::Serverless::Function
Transform: AWS::Serverless-2016-10-31