From 714cad6e391e05affe2be88297734c5d5df59775 Mon Sep 17 00:00:00 2001 From: Jacob Peterson <14127217+Petersoj@users.noreply.github.com> Date: Wed, 21 Aug 2024 11:53:27 -0700 Subject: [PATCH 1/2] fix(elasticache): use ID instead of name for default user filter --- resources/elasticache-users.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/elasticache-users.go b/resources/elasticache-users.go index 1e432b5d..87f0ccb4 100644 --- a/resources/elasticache-users.go +++ b/resources/elasticache-users.go @@ -5,6 +5,8 @@ import ( "fmt" "strings" + "github.com/gotidy/ptr" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/elasticache" @@ -71,7 +73,7 @@ func (l *ElasticacheUserLister) List(_ context.Context, o interface{}) ([]resour } func (i *ElasticacheUser) Filter() error { - if strings.HasPrefix(*i.userName, "default") { + if ptr.ToString(i.userID) == "default" { return fmt.Errorf("cannot delete default user") } return nil From 1620200ab9dc7eda4e6ea02bbd80739afebb83d4 Mon Sep 17 00:00:00 2001 From: Jacob Peterson <14127217+Petersoj@users.noreply.github.com> Date: Wed, 21 Aug 2024 12:00:16 -0700 Subject: [PATCH 2/2] fix(elasticache): remove unused import --- resources/elasticache-users.go | 1 - 1 file changed, 1 deletion(-) diff --git a/resources/elasticache-users.go b/resources/elasticache-users.go index 87f0ccb4..5552eb9e 100644 --- a/resources/elasticache-users.go +++ b/resources/elasticache-users.go @@ -3,7 +3,6 @@ package resources import ( "context" "fmt" - "strings" "github.com/gotidy/ptr"