Skip to content

Commit 352d46d

Browse files
authored
fix: Don't error on ECR repositories when they're missing Lifecycle policies (aws_ecr_repository_lifecycle_policies) (#14730)
#### Summary Similar to #14726 . We're calling `GetLifecyclePolicy` for every ECR repository in account and this API will throw an error if a Lifecycle is not configured for said ECR Repository. ``` 3:46PM ERR table resolver finished with error error="operation error ECR: GetLifecyclePolicy, https response error StatusCode: 400, RequestID:(redacted), LifecyclePolicyNotFoundException: Lifecycle policy does not exist for the repository with name '(redacted)' in the registry with id '(redacted)'" client=(redacted) module=aws-src table=aws_ecr_repository_lifecycle_policies ``` I don't think we should treat this as an error from Cloudquerys perspective. <!--
1 parent 4993cea commit 352d46d

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

plugins/source/aws/resources/services/ecr/lifecycle_policy.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ func fetchRepositoryLifecyclePolicy(ctx context.Context, meta schema.ClientMeta,
3838
options.Region = cl.Region
3939
})
4040
if err != nil {
41+
if client.IsAWSError(err, "LifecyclePolicyNotFound") {
42+
return nil
43+
}
4144
return err
4245
}
4346
res <- resp

0 commit comments

Comments
 (0)