在 AWS ECR 中,您可以向特定 AWS 账户授予针对存储库操作的权限。以下示例说明如何将帐户 ID 添加到 ECR 存储库的权限。
aws ecr set-repository-policy --repository-name my-repo --policy-text '{"Version":"2008-10-17","Statement":[{"Sid":"new-account-access","Effect":"Allow","Principal":{"AWS":"arn:aws:iam::ACCOUNT-ID:user/user-name"},"Action":["ecr:GetDownloadUrlForLayer","ecr:BatchGetImage","ecr:DescribeImages","ecr:GetRepositoryPolicy","ecr:DescribeRepositories","ecr:GetAuthorizationToken","ecr:ListImages"],"Resource":"arn:aws:ecr:REGION:ACCOUNT-ID:repository/my-repo"}]}'
其中,'my-repo”是要授权的 ECR 存储库的名称,'ACCOUNT-ID”是要授权的 AWS 帐户 ID。'REGION”替换为存储库所在的 AWS 区域。
{
"Version": "2008-10-17",
"Statement": [
{
"Sid": "new-account-access",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws
上一篇:AddingallexpressionsinsidetheloopasORconditiontotheIQueryableobjectC#
下一篇:AddingandHyperlinkingtoaWindowsstyleW:ilepathilename.pdfinForms.xml