aws/aws-cdk
在 GitHub 查看(ecs-patterns): allow specifying IAM-role for `EcsTask` through `ScheduledFargateTask`
Open
#22,673 建立於 2022年10月27日
@aws-cdk/aws-ecs-patternseffort/smallfeature-requestgood first issuep2
倉庫指標
- Star
- (10,710 star)
- PR 合併指標
- (平均合併 14天 11小時) (30 天內合併 68 個 PR)
描述
Describe the feature
Allow passing a IAM Role to ScheduledFargateTask which in turn is passed as the role argument to EcsTask.
Use Case
The default IAM role created in EcsTask gets a policy for ecs:RunTask with the full task definition arn as the resource, that is with its revision. I want to be able to set a ecs:RunTask policy with a wild card as the task definition revision component, i.e instead of:
PolicyStatement(
actions=["ecs:RunTask"],
resource=["arn:aws:ecs:XX:XX:task-definition/some-task-definition:42"],
...
)
I want:
PolicyStatement(
actions=["ecs:RunTask"],
resource=["arn:aws:ecs:XX:XX:task-definition/some-task-definition:*"],
...
)
Proposed Solution
My proposal is to leverage the already existing role argument on EcsTask by simply adding the same argument to ScheduledFargateTask and passing it on through.
Other Information
No response
Acknowledgements
- I may be able to implement this feature request
- This feature might incur a breaking change
CDK version used
2.44
Environment details (OS name and version, etc.)
MacOS 12.6.1