Setting a Principal in an access policy will effectively grant users, accounts, or services with access to each repository. For more information on how to properly assign a Principal within the ECR policy, see the AWS documentation.
References:
https://docs.aws.amazon.com/AmazonECR/latest/userguide/repository-policies.html
In AWS Console -
In Terraform -
References:
https://docs.aws.amazon.com/AmazonECR/latest/userguide/security-iam.html
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ecr_repository_policy