diff --git a/aws/policy/storage-services.yaml b/aws/policy/storage-services.yaml index 8edd16a..f1fcc8a 100644 --- a/aws/policy/storage-services.yaml +++ b/aws/policy/storage-services.yaml @@ -81,4 +81,5 @@ Statement: - memorydb:CreateSubnetGroup - memorydb:CreateUser - memorydb:CreateACL + - memorydb:CreateSnapshot Resource: "*" diff --git a/aws/terminator/storage_services.py b/aws/terminator/storage_services.py index 75739d9..1617299 100644 --- a/aws/terminator/storage_services.py +++ b/aws/terminator/storage_services.py @@ -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)