@@ -2,6 +2,7 @@ package resources
22
33import (
44 "context"
5+ "fmt"
56 "time"
67
78 "github.com/aws/aws-sdk-go/aws" //nolint:staticcheck
@@ -54,10 +55,11 @@ func (l *NeptuneSnapshotLister) List(_ context.Context, o interface{}) ([]resour
5455
5556 for _ , dbClusterSnapshot := range output .DBClusterSnapshots {
5657 resources = append (resources , & NeptuneSnapshot {
57- svc : svc ,
58- ID : dbClusterSnapshot .DBClusterSnapshotIdentifier ,
59- Status : dbClusterSnapshot .Status ,
60- CreateTime : dbClusterSnapshot .SnapshotCreateTime ,
58+ svc : svc ,
59+ ID : dbClusterSnapshot .DBClusterSnapshotIdentifier ,
60+ Status : dbClusterSnapshot .Status ,
61+ SnapshotType : dbClusterSnapshot .SnapshotType ,
62+ CreateTime : dbClusterSnapshot .SnapshotCreateTime ,
6163 })
6264 }
6365
@@ -72,10 +74,18 @@ func (l *NeptuneSnapshotLister) List(_ context.Context, o interface{}) ([]resour
7274}
7375
7476type NeptuneSnapshot struct {
75- svc * neptune.Neptune
76- ID * string
77- Status * string
78- CreateTime * time.Time
77+ svc * neptune.Neptune
78+ ID * string
79+ Status * string
80+ SnapshotType * string
81+ CreateTime * time.Time
82+ }
83+
84+ func (r * NeptuneSnapshot ) Filter () error {
85+ if * r .SnapshotType == "automated" {
86+ return fmt .Errorf ("cannot delete automated snapshots" )
87+ }
88+ return nil
7989}
8090
8191func (r * NeptuneSnapshot ) Remove (_ context.Context ) error {
0 commit comments