-
Notifications
You must be signed in to change notification settings - Fork 1
/
template.yml
112 lines (107 loc) · 3.56 KB
/
template.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
102
103
104
105
106
107
108
109
110
111
112
AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31
Description: >
ds-caselaw-ingester
TNA Caselaw ingester lambda
# More info about Globals: https://github.com/awslabs/serverless-application-model/blob/master/docs/globals.rst
Globals:
Function:
Timeout: 3
Parameters:
AwsBucketName:
Description: "AWS_BUCKET_NAME"
Type: "String"
EditorialUiBaseUrl:
Description: "EDITORIAL_UI_BASE_URL"
Type: "String"
MarklogicHost:
Description: "MARKLOGIC_HOST"
Type: "String"
MarklogicPassword:
Description: "MARKLOGIC_PASSWORD"
Type: "String"
MarklogicUser:
Description: "MARKLOGIC_USER"
Type: "String"
MaxRetries:
Description: "MAX_RETRIES"
Type: "String"
NotifyApiKey:
Description: "NOTIFY_API_KEY"
Type: "String"
NotifyEditorialAddress:
Description: "NOTIFY_EDITORIAL_ADDRESS"
Type: "String"
NotifyNewJudgmentTemplateId:
Description: "NOTIFY_NEW_JUDGMENT_TEMPLATE_ID"
Type: "String"
NotifyUpdatedJudgmentTemplateId:
Description: "NOTIFY_UPDATED_JUDGMENT_TEMPLATE_ID"
Type: "String"
PublicAssetBucket:
Description: "PUBLIC_ASSET_BUCKET"
Type: "String"
RollbarEnv:
Description: "ROLLBAR_ENV"
Type: "String"
RollbarToken:
Description: "ROLLBAR_TOKEN"
Type: "String"
SqsQueueUrl:
Description: "SQS_QUEUE_URL"
Type: "String"
VpcSubnetId0:
Description: "VPC Subnet ID 0"
Type: "String"
VpcSubnetId1:
Description: "VPC Subnet ID 1"
Type: "String"
VpcSubnetId2:
Description: "VPC Subnet ID 2"
Type: "String"
VpcSecurityGroupId:
Description: "VPC Security Group ID"
Type: "String"
Resources:
TNACaselawIngesterFunction:
Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
Properties:
CodeUri: ds-caselaw-ingester/
Handler: lambda_function.handler
Runtime: python3.11
Architectures:
- x86_64
Timeout: 420
Environment:
Variables:
AWS_BUCKET_NAME: !Ref AwsBucketName
EDITORIAL_UI_BASE_URL: !Ref EditorialUiBaseUrl
MARKLOGIC_HOST: !Ref MarklogicHost
MARKLOGIC_PASSWORD: !Ref MarklogicPassword
MARKLOGIC_USER: !Ref MarklogicUser
MAX_RETRIES: !Ref MaxRetries
NOTIFY_API_KEY: !Ref NotifyApiKey
NOTIFY_EDITORIAL_ADDRESS: !Ref NotifyEditorialAddress
NOTIFY_NEW_JUDGMENT_TEMPLATE_ID: !Ref NotifyNewJudgmentTemplateId
NOTIFY_UPDATED_JUDGMENT_TEMPLATE_ID: !Ref NotifyUpdatedJudgmentTemplateId
PUBLIC_ASSET_BUCKET: !Ref PublicAssetBucket
ROLLBAR_ENV: !Ref RollbarEnv
ROLLBAR_TOKEN: !Ref RollbarToken
SQS_QUEUE_URL: !Ref SqsQueueUrl
VpcConfig:
SubnetIds:
- !Ref VpcSubnetId0
- !Ref VpcSubnetId1
- !Ref VpcSubnetId2
SecurityGroupIds:
- !Ref VpcSecurityGroupId
Outputs:
# ServerlessRestApi is an implicit API created out of Events key under Serverless::Function
# Find out more about other implicit resources you can reference within SAM
# https://github.com/awslabs/serverless-application-model/blob/master/docs/internals/generated_resources.rst#api
TNACaselawIngesterFunction:
Description: "TNA Caselaw Ingester Lambda Function ARN"
Value: !GetAtt TNACaselawIngesterFunction.Arn
TNACaselawIngesterFunctionIamRole:
Description: "Implicit IAM Role created for TNA Caselaw Ingester function"
Value: !GetAtt TNACaselawIngesterFunctionRole.Arn