Skip to content

Commit

Permalink
Add snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
GomathiselviS committed Aug 15, 2023
1 parent 4ae3ef3 commit dbd1988
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions aws/policy/storage-services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,5 @@ Statement:
- memorydb:CreateSubnetGroup
- memorydb:CreateUser
- memorydb:CreateACL
- memorydb:CreateSnapshot
Resource: "*"
16 changes: 16 additions & 0 deletions aws/terminator/storage_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,3 +304,19 @@ def name(self):

def terminate(self):
self.client.delete_user(UserName=self.name)

class MemoryDBSnapshots(Terminator):
@staticmethod
def create(credentials):
return Terminator._create(credentials, MemoryDBSnapshots, 'memorydb', lambda client: client.describe_snapshots()['Snapshots'])

@property
def id(self):
return self.instance["ARN"]

@property
def name(self):
return self.instance["Name"]

def terminate(self):
self.client.delete_snapshot(SnapshotName=self.name)

0 comments on commit dbd1988

Please sign in to comment.