How to add a policy statement to a ecr repository #24198
Unanswered
shivam-malvia-polestar
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
let policy = new iam.PolicyDocument({
statements: [
new iam.PolicyStatement({
sid: 'CrossAccountPermission',
principals: principalArr,
actions: [
'ecr:BatchCheckLayerAvailability',
'ecr:BatchGetImage',
'ecr:DescribeImages',
'ecr:DescribeRepositories',
'ecr:GetDownloadUrlForLayer',
'ecr:ListImages'
],
}),
new iam.PolicyStatement({
sid:'LambdaECRImageCrossAccountRetrievalPolicy',
effect: iam.Effect.ALLOW,
principals: lambdaPrincipal,
actions: [
'ecr:BatchGetImage',
'ecr:GetDownloadUrlForLayer'
]
})
]
});
const ecrRepo = ecr.Repository.fromRepositoryName(scope, props.repoName + 'repository', props.repoName);
Now there is no method in ecr repo to add policy document, although there is a method to add policy statement.
can someone please help me on how do i add multiple statement or policy document to a repo.
Beta Was this translation helpful? Give feedback.
All reactions