Skip to content

Commit

Permalink
fix policy for iam user in pulumi program
Browse files Browse the repository at this point in the history
  • Loading branch information
mt7180 committed Dec 19, 2023
1 parent 109f0d7 commit 2a6a061
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions infrastructure/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,27 +210,27 @@

# Following policies will be needed by your IAM User to make the Prefet ecs:push work pool run:

policy_document = aws.iam.get_policy_document(
statements=[
iam_policy = aws.iam.Policy(
"prefect_ecs_push_policies",
policy=json.dumps(
{
"actions": [
"ecs:RegisterTaskDefinition",
"ecs:RunTask",
"iam:PassRole",
"ecr:GetAuthorizationToken",
"ecr:BatchGetImage",
"ecr:GetDownloadUrlForLayer",
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"ecs:RegisterTaskDefinition",
"ecs:RunTask",
"iam:PassRole",
"ecr:GetAuthorizationToken",
"ecr:BatchGetImage",
"ecr:GetDownloadUrlForLayer",
],
"Effect": "Allow",
"Resource": "*",
},
],
"resources": ["*"],
"effect": "Allow",
}
],
opts=pulumi.ResourceOptions(provider=assumed_role_provider),
)

iam_policy = aws.iam.Policy(
"prefect_ecs_push_policies",
policy=policy_document.json,
),
description="Policies that are needed by IAM user to make the Prefet ecs:push work pool run",
opts=pulumi.ResourceOptions(provider=assumed_role_provider),
)
Expand Down

0 comments on commit 2a6a061

Please sign in to comment.