Skip to content

Commit

Permalink
Add UpdateReplacePolicy and DeletionPolicy to Integ Test Resoruces (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
GavinZZ authored Sep 18, 2023
1 parent 40c6c0f commit e3b754d
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,15 @@ Resources:
}
MyCognitoUserPool:
UpdateReplacePolicy: Delete
DeletionPolicy: Delete
Type: AWS::Cognito::UserPool
Properties:
UserPoolName: MyCognitoUserPool

MyCognitoUserPoolClient:
UpdateReplacePolicy: Delete
DeletionPolicy: Delete
Type: AWS::Cognito::UserPoolClient
Properties:
UserPoolId:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Parameters:

Resources:
VerificationQueue:
UpdateReplacePolicy: Delete
DeletionPolicy: Delete
Type: AWS::SQS::Queue

TriggerFunction:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,15 @@ Resources:
QueueName: !GetAtt VerificationQueue.QueueName

CustomEventBus:
UpdateReplacePolicy: Delete
DeletionPolicy: Delete
Type: AWS::Events::EventBus
Properties:
Name: !Sub "${AWS::StackName}-EventBus"

EventRule:
UpdateReplacePolicy: Delete
DeletionPolicy: Delete
Type: AWS::Events::Rule
Properties:
Description: !Sub 'EventRule-${AWS::StackName}'
Expand Down Expand Up @@ -86,6 +90,8 @@ Resources:
- Write

VerificationEventRule:
UpdateReplacePolicy: Delete
DeletionPolicy: Delete
Type: AWS::Events::Rule
Properties:
Description: !Sub 'EventRule-${AWS::StackName}-verification'
Expand All @@ -97,6 +103,8 @@ Resources:
Id: SQSqueue

VerificationQueue:
UpdateReplacePolicy: Delete
DeletionPolicy: Delete
Type: AWS::SQS::Queue

ConnectorNotBeingTested:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Resources:
TriggerStateMachine:
UpdateReplacePolicy: Delete
DeletionPolicy: Delete
Type: AWS::Serverless::StateMachine
Properties:
Type: EXPRESS
Expand All @@ -18,6 +20,8 @@ Resources:
FunctionName: SomethingDoesNotMatter

MyQueue:
UpdateReplacePolicy: Delete
DeletionPolicy: Delete
Type: AWS::SQS::Queue

MyConnector:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,13 @@ Resources:
StartingPosition: LATEST

Notifications:
UpdateReplacePolicy: Delete
DeletionPolicy: Delete
Type: AWS::SNS::Topic

Images:
UpdateReplacePolicy: Delete
DeletionPolicy: Delete
Type: AWS::S3::Bucket

ExistingRestApi:
Expand All @@ -82,12 +86,16 @@ Resources:
DefinitionUri: ${definitionuri}

Stream:
UpdateReplacePolicy: Delete
DeletionPolicy: Delete
Type: AWS::Kinesis::Stream
Properties:
ShardCount: 1

# What an irony the I can't use AWS::Serverless::SimpleTable here because it doesn't support streams specification
MyTable:
UpdateReplacePolicy: Delete
DeletionPolicy: Delete
Type: AWS::DynamoDB::Table
Properties:
# Enable DDB streams
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,25 +107,35 @@ Resources:
Method: get

Notifications:
UpdateReplacePolicy: Delete
DeletionPolicy: Delete
Condition: MyCondition
Type: AWS::SNS::Topic

Images:
UpdateReplacePolicy: Delete
DeletionPolicy: Delete
Type: AWS::S3::Bucket

CloudWatchLambdaLogsGroup:
UpdateReplacePolicy: Delete
DeletionPolicy: Delete
Type: AWS::Logs::LogGroup
Condition: MyCondition
Properties:
RetentionInDays: 7

MyStream:
UpdateReplacePolicy: Delete
DeletionPolicy: Delete
Type: AWS::Kinesis::Stream
Condition: MyCondition
Properties:
ShardCount: 1

MyDynamoDB:
UpdateReplacePolicy: Delete
DeletionPolicy: Delete
Type: AWS::DynamoDB::Table
Condition: MyCondition
Properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Resources:
FilterPattern: My filter pattern

CloudWatchLambdaLogsGroup:
UpdateReplacePolicy: Delete
DeletionPolicy: Delete
Type: AWS::Logs::LogGroup
Properties:
RetentionInDays: 7
Expand Down

0 comments on commit e3b754d

Please sign in to comment.