Skip to content

Commit

Permalink
OJ-2798: Removed delete state machine
Browse files Browse the repository at this point in the history
  • Loading branch information
surajkumar committed Oct 29, 2024
1 parent 5f75453 commit 4868803
Show file tree
Hide file tree
Showing 10 changed files with 0 additions and 690 deletions.
151 changes: 0 additions & 151 deletions infrastructure/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -184,157 +184,6 @@ Globals:
AutoPublishAlias: live

Resources:
#################
# START OJ-2798 #
#################
PersonDeleteRecordsStateMachine:
Type: AWS::Serverless::StateMachine
Properties:
Name: !Sub ${AWS::StackName}-PersonDeleteRecordsStateMachine
Type: EXPRESS
DefinitionUri: ../step-functions/delete-person-identity-records.asl.json
DefinitionSubstitutions:
TableName: !Sub "{{resolve:ssm:/${CommonStackName}/PersonIdentityTableName}}"
StateMachineArn: !Sub arn:aws:states:${AWS::Region}:${AWS::AccountId}:stateMachine:${AWS::StackName}-PersonDeleteRecordsStateMachine
SleepFunction: !Ref SleepFunction
Logging:
Destinations:
- CloudWatchLogsLogGroup:
LogGroupArn: !GetAtt PersonDeleteRecordsStateMachineLogGroup.Arn
IncludeExecutionData: True
Level: ALL
Policies:
- LambdaInvokePolicy:
FunctionName: !Ref SleepFunction
- DynamoDBCrudPolicy:
TableName: !Sub "{{resolve:ssm:/${CommonStackName}/PersonIdentityTableName}}"
- Statement:
Effect: Allow
Action:
- states:StartExecution
- states:StartSyncExecution
Resource: !Sub arn:aws:states:${AWS::Region}:${AWS::AccountId}:stateMachine:${AWS::StackName}-PersonDeleteRecordsStateMachine
- Statement:
Effect: Allow
Action: logs:*
Resource: "*"
PermissionsBoundary: !If
- UsePermissionsBoundary
- !Ref PermissionsBoundary
- !Ref AWS::NoValue
PersonDeleteRecordsStateMachineLogGroup:
Type: AWS::Logs::LogGroup
Properties:
LogGroupName: !Sub /aws/vendedlogs/states/${AWS::StackName}-PersonDeleteRecordsStateMachine
RetentionInDays: 30

AttemptTblDelRecordsStateMachine:
Type: AWS::Serverless::StateMachine
Properties:
Name: !Sub ${AWS::StackName}-AttemptTblDelRecordsStateMachine
Type: EXPRESS
DefinitionUri: ../step-functions/delete-attempts-records.asl.json
DefinitionSubstitutions:
TableName: !Ref UserAttemptsTable
StateMachineArn: !Sub arn:aws:states:${AWS::Region}:${AWS::AccountId}:stateMachine:${AWS::StackName}-AttemptTblDelRecordsStateMachine
SleepFunction: !Ref SleepFunction
Logging:
Destinations:
- CloudWatchLogsLogGroup:
LogGroupArn: !GetAtt AttemptTblDelRecordsStateMachineLogGroup.Arn
IncludeExecutionData: True
Level: ALL
Policies:
- LambdaInvokePolicy:
FunctionName: !Ref SleepFunction
- DynamoDBCrudPolicy:
TableName: !Ref UserAttemptsTable
- Statement:
Effect: Allow
Action:
- states:StartExecution
- states:StartSyncExecution
Resource: !Sub arn:aws:states:${AWS::Region}:${AWS::AccountId}:stateMachine:${AWS::StackName}-AttemptTblDelRecordsStateMachine
- Statement:
Effect: Allow
Action: logs:*
Resource: "*"
PermissionsBoundary: !If
- UsePermissionsBoundary
- !Ref PermissionsBoundary
- !Ref AWS::NoValue
AttemptTblDelRecordsStateMachineLogGroup:
Type: AWS::Logs::LogGroup
Properties:
LogGroupName: !Sub /aws/vendedlogs/states/${AWS::StackName}-AttemptTblDelRecordsStateMachine
RetentionInDays: 30

UserTblDelRecordsStateMachine:
Type: AWS::Serverless::StateMachine
Properties:
Name: !Sub ${AWS::StackName}-UserTblDelRecordsStateMachine
Type: EXPRESS
DefinitionUri: ../step-functions/delete-records.asl.json
DefinitionSubstitutions:
TableName: !Ref NinoUsersTable
StateMachineArn: !Sub arn:aws:states:${AWS::Region}:${AWS::AccountId}:stateMachine:${AWS::StackName}-UserTblDelRecordsStateMachine
SleepFunction: !Ref SleepFunction
Logging:
Destinations:
- CloudWatchLogsLogGroup:
LogGroupArn: !GetAtt UserTblDelRecordsStateMachineLogGroup.Arn
IncludeExecutionData: True
Level: ALL
Policies:
- LambdaInvokePolicy:
FunctionName: !Ref SleepFunction
- DynamoDBCrudPolicy:
TableName: !Ref NinoUsersTable
- Statement:
Effect: Allow
Action:
- states:StartExecution
- states:StartSyncExecution
Resource: !Sub arn:aws:states:${AWS::Region}:${AWS::AccountId}:stateMachine:${AWS::StackName}-UserTblDelRecordsStateMachine
- Statement:
Effect: Allow
Action: logs:*
Resource: "*"
PermissionsBoundary: !If
- UsePermissionsBoundary
- !Ref PermissionsBoundary
- !Ref AWS::NoValue
UserTblDelRecordsStateMachineLogGroup:
Type: AWS::Logs::LogGroup
Properties:
LogGroupName: !Sub /aws/vendedlogs/states/${AWS::StackName}-UserTblDelRecordsStateMachine
RetentionInDays: 30

SleepFunction:
Type: AWS::Serverless::Function
Metadata:
BuildMethod: esbuild
BuildProperties:
Sourcemap: true
Properties:
Handler: lambdas/sleep-function/src/sleep-function.lambdaHandler
LoggingConfig:
LogGroup: !Sub /aws/lambda/${AWS::StackName}/SleepFunction
CodeSigningConfigArn:
!If [EnforceCodeSigning, !Ref CodeSigningConfigArn, !Ref AWS::NoValue]
Environment:
Variables:
POWERTOOLS_SERVICE_NAME: !Sub ${CriIdentifier}-SleepFunction

SleepFunctionLogGroup:
Type: AWS::Logs::LogGroup
Properties:
LogGroupName: !Sub /aws/lambda/${AWS::StackName}/SleepFunction
RetentionInDays: 30
###############
# END OJ-2798 #
###############

EpochTimeFunction:
Type: AWS::Serverless::Function
Metadata:
Expand Down
7 changes: 0 additions & 7 deletions lambdas/sleep-function/jest.config.ts

This file was deleted.

14 changes: 0 additions & 14 deletions lambdas/sleep-function/package.json

This file was deleted.

10 changes: 0 additions & 10 deletions lambdas/sleep-function/src/sleep-function.ts

This file was deleted.

11 changes: 0 additions & 11 deletions lambdas/sleep-function/tests/sleep-function.test.ts

This file was deleted.

19 changes: 0 additions & 19 deletions lambdas/sleep-function/tsconfig.json

This file was deleted.

8 changes: 0 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4868803

Please sign in to comment.