Skip to content

Commit 30f3968

Browse files
Sander Knapemergify[bot]
authored andcommitted
fix(ecr): set correct resource policy for ecr repository (#3590)
* fix(ecr): set correct resource policy for ecr repository * Use the full ARN of the repository in the ECR policy This fixes the aws-ecr-assets test where an IAM user receives the policy instead of the ECR repository. * Remove resource statement when resource policy is changed
1 parent 8d3cf77 commit 30f3968

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

packages/@aws-cdk/aws-ecr/lib/repository.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ export abstract class RepositoryBase extends Resource implements IRepository {
179179
grantee,
180180
actions,
181181
resourceArns: [this.repositoryArn],
182-
resourceSelfArns: ['*'],
182+
resourceSelfArns: [],
183183
resource: this,
184184
});
185185
}

packages/@aws-cdk/aws-ecr/test/test.repository.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,6 @@ export = {
377377
],
378378
"Effect": "Allow",
379379
"Principal": "*",
380-
"Resource": "*",
381380
}
382381
],
383382
"Version": "2012-10-17"

0 commit comments

Comments
 (0)