Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OJ-2798: Removed delete state machine #483

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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