Skip to content

Commit

Permalink
fix(cloudfront-cache-policy): add legacy stringer, add name property
Browse files Browse the repository at this point in the history
  • Loading branch information
ekristen committed Apr 13, 2024
1 parent 0e99104 commit c5f55cd
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions resources/cloudfront-cache-policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ import (
)

type CloudFrontCachePolicy struct {
svc *cloudfront.CloudFront
ID *string
svc *cloudfront.CloudFront
ID *string
Name *string
}

const CloudFrontCachePolicyResource = "CloudFrontCachePolicy"
Expand Down Expand Up @@ -45,8 +46,9 @@ func (l *CloudFrontCachePolicyLister) List(_ context.Context, o interface{}) ([]
for _, item := range resp.CachePolicyList.Items {
if *item.Type == "custom" { //nolint:goconst
resources = append(resources, &CloudFrontCachePolicy{
svc: svc,
ID: item.CachePolicy.Id,
svc: svc,
ID: item.CachePolicy.Id,
Name: item.CachePolicy.CachePolicyConfig.Name,
})
}
}
Expand Down Expand Up @@ -80,5 +82,10 @@ func (f *CloudFrontCachePolicy) Remove(_ context.Context) error {
func (f *CloudFrontCachePolicy) Properties() types.Properties {
properties := types.NewProperties()
properties.Set("ID", f.ID)
properties.Set("Name", f.Name)
return properties
}

func (f *CloudFrontCachePolicy) String() string {
return *f.Name
}

0 comments on commit c5f55cd

Please sign in to comment.