Skip to content

Commit

Permalink
fix(ecr): set correct resource policy for ecr repository (#3590)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Sander Knape authored and mergify[bot] committed Aug 19, 2019
1 parent 8d3cf77 commit 30f3968
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-ecr/lib/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export abstract class RepositoryBase extends Resource implements IRepository {
grantee,
actions,
resourceArns: [this.repositoryArn],
resourceSelfArns: ['*'],
resourceSelfArns: [],
resource: this,
});
}
Expand Down
1 change: 0 additions & 1 deletion packages/@aws-cdk/aws-ecr/test/test.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,6 @@ export = {
],
"Effect": "Allow",
"Principal": "*",
"Resource": "*",
}
],
"Version": "2012-10-17"
Expand Down

0 comments on commit 30f3968

Please sign in to comment.