Skip to content
This repository has been archived by the owner on Aug 16, 2022. It is now read-only.

Commit

Permalink
fix: Ignore CF distributions NoSuchResource on ListTags (#1238)
Browse files Browse the repository at this point in the history
  • Loading branch information
zagronitay committed Jul 22, 2022
1 parent 004a544 commit 01efd1a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions client/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ var notFoundErrorSubstrings = []string{
"NotFound",
"ResourceNotFoundException",
"WAFNonexistentItemException",
"NoSuchResource",
}

var accessDeniedErrorStrings = map[string]struct{}{
Expand Down
3 changes: 3 additions & 0 deletions resources/services/cloudfront/distributions.go
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,9 @@ func resolveCloudfrontDistributionTags(ctx context.Context, meta schema.ClientMe
options.Region = cl.Region
})
if err != nil {
if cl.IsNotFoundError(err) {
return nil
}
return diag.WrapError(err)
}
return diag.WrapError(resource.Set(c.Name, client.TagsToMap(response.Tags.Items)))
Expand Down

0 comments on commit 01efd1a

Please sign in to comment.