-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathserverless.yml
124 lines (112 loc) · 3.1 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
service: dynamodb-process-metadata
frameworkVersion: '3'
provider:
name: aws
runtime: python3.7
memorySize: 512
timeout: 600
architecture: x86_64
stackTags:
product: soumil
env: qa
created-date: 2022-04-26
team: python-dev
customer-impact: false
terraform: false
useDotenv: true
functions:
lambda:
handler: lambda_function.lambda_handler
environment:
DEV_AWS_ACCESS_KEY: ${env:AWS_ACCESS_KEY}
DEV_AWS_SECRET_KEY: ${env:AWS_SECRET_KEY}
DEV_AWS_REGION_NAME: ${env:AWS_REGION}
TopicArn: arn:aws:sns:us-east-1:${env:ACCOUNT}:${env:TopicName}
events:
- stream:
type: kinesis
arn:
Fn::GetAtt:
- KinesisDataStreams
- Arn
resources:
Resources:
SNSTopic:
Type: AWS::SNS::Topic
Properties:
TopicName: ${env:TopicName}
MySubscription:
Type: AWS::SNS::Subscription
Properties:
Endpoint: your_email.com
Protocol: email
TopicArn: !Ref 'SNSTopic'
myTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: ${env:TABLE_NAME}
AttributeDefinitions:
- AttributeName: pk
AttributeType: S
- AttributeName: sk
AttributeType: S
- AttributeName: gs1_process
AttributeType: S
- AttributeName: gsi_date_month
AttributeType: S
- AttributeName: gsi_date_day
AttributeType: S
KeySchema:
- AttributeName: pk
KeyType: HASH
- AttributeName: sk
KeyType: RANGE
BillingMode: PAY_PER_REQUEST
TableClass: STANDARD
PointInTimeRecoverySpecification:
PointInTimeRecoveryEnabled: false
GlobalSecondaryIndexes:
- IndexName: ${env:GS1_INDEX}
KeySchema:
-
AttributeName: "gs1_process"
KeyType: "HASH"
-
AttributeName: "pk"
KeyType: "RANGE"
Projection:
ProjectionType: ALL
- IndexName: ${env:GS2_DAY_INDEX}
KeySchema:
-
AttributeName: "gsi_date_day"
KeyType: "HASH"
-
AttributeName: "pk"
KeyType: "RANGE"
Projection:
ProjectionType: ALL
- IndexName: ${env:GSI_MONTH_INDEX}
KeySchema:
-
AttributeName: "gsi_date_month"
KeyType: "HASH"
-
AttributeName: "pk"
KeyType: "RANGE"
Projection:
ProjectionType: ALL
KinesisStreamSpecification:
StreamArn: !GetAtt KinesisDataStreams.Arn
Tags:
- Key: 'product'
Value: 'soumil'
- Key: 'customerImpact'
Value: 'false'
KinesisDataStreams:
Type: AWS::Kinesis::Stream
Properties:
Name: ${env:StreamName}
RetentionPeriodHours: ${env:RetentionPeriodHours}
StreamModeDetails:
StreamMode: ON_DEMAND