fix(aws): solve invalid ECR Registry ARN (#5622)

This commit is contained in:
Sergio Garcia
2024-11-04 10:47:49 -06:00
committed by GitHub
parent 5fbf8ddfe9
commit 84d4e4a604
2 changed files with 5 additions and 1 deletions
@@ -58,7 +58,7 @@ class ECR(AWSService):
# The default ECR registry is assumed
self.registries[regional_client.region] = Registry(
id=self.registry_id,
arn=f"arn:{self.audited_partition}:ecr:{regional_client.region}:registry/{self.registry_id}",
arn=f"arn:{self.audited_partition}:ecr:{regional_client.region}:{self.audited_account}:registry/{self.registry_id}",
region=regional_client.region,
repositories=regional_registry_repositories,
)
@@ -203,6 +203,10 @@ class Test_ECR_Service:
assert len(ecr.registries) == 1
assert ecr.registries[AWS_REGION_EU_WEST_1].id == AWS_ACCOUNT_NUMBER
assert (
ecr.registries[AWS_REGION_EU_WEST_1].arn
== f"arn:aws:ecr:{AWS_REGION_EU_WEST_1}:{AWS_ACCOUNT_NUMBER}:registry/{AWS_ACCOUNT_NUMBER}"
)
assert ecr.registries[AWS_REGION_EU_WEST_1].region == AWS_REGION_EU_WEST_1
assert len(ecr.registries[AWS_REGION_EU_WEST_1].repositories) == 1