iam:PassRole action missing when running CDK task from aws cli #25764
-
Hi all, I have used cdk to create a FargateTaskDefinition, not attached to any service, that I want to run on-demand. I can successfully run the task from the AWS Console, however the same fails when calling "aws ecs run-task" from the aws cli with this error:
I have read about the PassRole action however I am lost in the maze of users/roles/policies/permissions... Any pointer in the right direction would be appreciated :) |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
I am able to run the task if I add the AmazonECS_FullAccess policy to the PowerUserAccess permission set... however, is that the right thing to do? Adding the AmazonECSTaskExecutionRolePolicy did not help, I received the same error. |
Beta Was this translation helpful? Give feedback.
-
The You need an additional policy which will allow for |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
The
PowerUserAccess
policy is a managed policy by amazon - it comes with permissions for everything except actions related to iam, accounts, and organizations. So since you neediam::PassRole
, this is not allowed with thePowerUserAccess
permission set.You need an additional policy which will allow for
iam::PassRole
on your task arn.AmazonECS_FullAccess
will grant this, andAmazonECSTaskExecutionRolePolicy
will not.