Skip to content

Commit e0b7956

Browse files
devksingh4krivera28
andcommitted
creating membership api dynamo tables
Co-authored-by: krivera28 <[email protected]>
1 parent c38551c commit e0b7956

File tree

2 files changed

+27
-9
lines changed

2 files changed

+27
-9
lines changed

cloudformation/iam.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ Resources:
7777
- !Sub arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/infra-core-api-iam-userroles/*
7878
- !Sub arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/infra-core-api-iam-grouproles
7979
- !Sub arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/infra-core-api-iam-grouproles/*
80+
- !Sub arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/infra-core-api-membership-logs
81+
- !Sub arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/infra-core-api-membership-logs/*
8082

8183
PolicyName: lambda-dynamo
8284
Outputs:
@@ -85,4 +87,4 @@ Outputs:
8587
Value:
8688
Fn::GetAtt:
8789
- ApiLambdaIAMRole
88-
- Arn
90+
- Arn

cloudformation/main.yml

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ Resources:
9393
Environment:
9494
Variables:
9595
RunEnvironment: !Ref RunEnvironment
96-
VpcConfig:
96+
VpcConfig:
9797
Ipv6AllowedForDualStack: !If [ShouldAttachVpc, True, !Ref AWS::NoValue]
9898
SecurityGroupIds: !If [ShouldAttachVpc, !FindInMap [EnvironmentToCidr, !Ref RunEnvironment, SecurityGroupIds], !Ref AWS::NoValue]
9999
SubnetIds: !If [ShouldAttachVpc, !FindInMap [EnvironmentToCidr, !Ref RunEnvironment, SubnetIds], !Ref AWS::NoValue]
@@ -107,7 +107,7 @@ Resources:
107107

108108
IamGroupRolesTable:
109109
Type: 'AWS::DynamoDB::Table'
110-
DeletionPolicy: "Retain"
110+
DeletionPolicy: "Retain"
111111
Properties:
112112
BillingMode: 'PAY_PER_REQUEST'
113113
TableName: infra-core-api-iam-grouproles
@@ -123,7 +123,7 @@ Resources:
123123

124124
IamUserRolesTable:
125125
Type: 'AWS::DynamoDB::Table'
126-
DeletionPolicy: "Retain"
126+
DeletionPolicy: "Retain"
127127
Properties:
128128
BillingMode: 'PAY_PER_REQUEST'
129129
TableName: infra-core-api-iam-userroles
@@ -139,7 +139,7 @@ Resources:
139139

140140
EventRecordsTable:
141141
Type: 'AWS::DynamoDB::Table'
142-
DeletionPolicy: "Retain"
142+
DeletionPolicy: "Retain"
143143
Properties:
144144
BillingMode: 'PAY_PER_REQUEST'
145145
TableName: infra-core-api-events
@@ -162,9 +162,25 @@ Resources:
162162
Projection:
163163
ProjectionType: ALL
164164

165+
MembershipRecordsTable:
166+
Type: 'AWS::DynamoDB::Table'
167+
DeletionPolicy: "Retain"
168+
Properties:
169+
BillingMode: 'PAY_PER_REQUEST'
170+
TableName: infra-core-api-membership-logs
171+
DeletionProtectionEnabled: true
172+
PointInTimeRecoverySpecification:
173+
PointInTimeRecoveryEnabled: !If [IsProd, true, false]
174+
AttributeDefinitions:
175+
- AttributeName: email
176+
AttributeType: S
177+
KeySchema:
178+
- AttributeName: email
179+
KeyType: HASH
180+
165181
CacheRecordsTable:
166182
Type: 'AWS::DynamoDB::Table'
167-
DeletionPolicy: "Retain"
183+
DeletionPolicy: "Retain"
168184
Properties:
169185
BillingMode: 'PAY_PER_REQUEST'
170186
TableName: infra-core-api-cache
@@ -183,7 +199,7 @@ Resources:
183199

184200
AppApiGateway:
185201
Type: AWS::Serverless::Api
186-
DependsOn:
202+
DependsOn:
187203
- AppApiLambdaFunction
188204
Properties:
189205
Name: !Sub ${ApplicationPrefix}-gateway
@@ -194,7 +210,7 @@ Resources:
194210
Name: AWS::Include
195211
Parameters:
196212
Location: ./phony-swagger.yml
197-
Domain:
213+
Domain:
198214
DomainName: !Sub
199215
- "${ApplicationPrefix}.${BaseDomainName}"
200216
- BaseDomainName: !FindInMap
@@ -296,4 +312,4 @@ Resources:
296312
- !Ref AWS::AccountId
297313
- ":"
298314
- !Ref AppApiGateway
299-
- "/*/*/*"
315+
- "/*/*/*"

0 commit comments

Comments
 (0)