Skip to content

Commit

Permalink
feat(kms-key): add kms alias to kms key for filtering purposes
Browse files Browse the repository at this point in the history
  • Loading branch information
ekristen committed Oct 11, 2024
1 parent 039688e commit 27e65bd
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions resources/kms-key.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,17 @@ func (l *KMSKeyLister) List(_ context.Context, o interface{}) ([]resource.Resour
}
}

keyAliases, err := svc.ListAliases(&kms.ListAliasesInput{
KeyId: key.KeyId,
})
if err != nil {
logrus.WithError(err).Error("unable to list aliases")
}

if len(keyAliases.Aliases) > 0 {
kmsKey.Alias = keyAliases.Aliases[0].AliasName
}

resources = append(resources, kmsKey)
}

Expand All @@ -118,6 +129,7 @@ type KMSKey struct {
ID *string
State *string
Manager *string
Alias *string
Tags []*kms.Tag
}

Expand Down

0 comments on commit 27e65bd

Please sign in to comment.