-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.yaml
56 lines (54 loc) · 1.54 KB
/
template.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
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: BCO-DMO Frictionlessdata Data Package Pipeline
Parameters:
Service:
Type: String
Description: The name of the service that we are deploying
Environment:
Type: String
Description: Environment to which we are deploying (prod, stage, dev, etc)
Bucket:
Type: String
Description: The S3 Bucket at which pipelines can be found.
BucketRegion:
Type: String
Description: The AWS region for the S3 Bucket of pipelines.
BcoDmoOfficeURI:
Type: String
Description: The Linked Data Identifier for the BCO-DMO Organization
Resources:
Dpp2ProvAPI:
Type: AWS::Serverless::Api
Properties:
StageName: Prod
Auth:
ApiKeyRequired: true # sets for all methods
UsagePlan:
CreateUsagePlan: SHARED
ToProv:
Type: AWS::Serverless::Function
Properties:
FunctionName: !Sub '${Service}-${Environment}-to-prov'
Handler: lambda_handlers.to_prov
Runtime: python3.8
CodeUri: backend/
Policies:
- S3ReadPolicy:
BucketName: !Ref Bucket
MemorySize: 3008
Timeout: 900
Environment:
Variables:
ENVIRONMENT: !Ref Environment
BUCKET: !Ref Bucket
BUCKET_REGION: !Ref BucketRegion
BCODMOOFFICEURI: !Ref BcoDmoOfficeURI
LOG_LEVEL: INFO
Events:
HttpGet:
Type: Api
Properties:
RestApiId: !Ref Dpp2ProvAPI
Path: '/prov'
Method: get