Skip to content

Commit

Permalink
Adding ecs:TagResource permission to IAM roles (#207)
Browse files Browse the repository at this point in the history
  • Loading branch information
davmayd authored May 2, 2024
1 parent 5c8971e commit b544546
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion cdk/examples/data_pipeline/python/lib/data_pipeline_roles.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

def add_step_function_role_policies(stepfunctionExecutionRole:iam.Role, data_pipeline_stack_props: DataPipelineStackProps):
stepfunctionExecutionRole.add_to_principal_policy(iam.PolicyStatement(
actions= ['ecs:RunTask'],
actions= ['ecs:RunTask',
"ecs:TagResource"],
effect= iam.Effect.ALLOW,
resources= ['arn:aws:ecs:'+data_pipeline_stack_props.aws_region+':'+data_pipeline_stack_props.account_number+':task-definition/*']
))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { Effect, ManagedPolicy, Policy, PolicyStatement, Role } from "aws-cdk-li

export function addStepFunctionRolePolicies(account: String, region: String, stepFunctionExecutionRole: Role) {
stepFunctionExecutionRole.addToPrincipalPolicy(new PolicyStatement({
actions:["ecs:RunTask"],
actions:["ecs:RunTask",
"ecs:TagResource"],
effect: Effect.ALLOW,
resources: [`arn:aws:ecs:${region}:${account}:task-definition/*`]
}))
Expand Down
3 changes: 2 additions & 1 deletion terraform/fargate-examples/queue-processing/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,8 @@ data "aws_iam_policy_document" "lambda_role" {
"ecs:DescribeTasks",
"ecs:ListTasks",
"ecs:StartTask",
"ecs:RunTask"
"ecs:RunTask",
"ecs:TagResource"
]
resources = ["*"]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,8 @@ data "aws_iam_policy_document" "lambda_role" {
"ecs:DescribeTasks",
"ecs:ListTasks",
"ecs:StartTask",
"ecs:RunTask"
"ecs:RunTask",
"ecs:TagResource"
]
resources = ["*"]
}
Expand Down

0 comments on commit b544546

Please sign in to comment.