Skip to content

Commit

Permalink
Merge pull request #137 from ekristen/fix-cloudfront-cache-policy
Browse files Browse the repository at this point in the history
fix(cloudfront-cache-policy): add legacy stringer, add name property
  • Loading branch information
ekristen authored Apr 13, 2024
2 parents 0e99104 + c5f55cd commit 2fec95f
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 2fec95f

Please sign in to comment.