Repository navigation
|
Testing shows I am not inheriting a created ec2 launch role, but this would be an acceptable solution, ignoring security concerns (not ideal but acceptable initially). I may be able to set the generated task role to None (python). so that this effective inheritance occurs (task role gets ec2 role policy). I cannot directly override the created task role on the EcsRunnerProvider. Another approach is to create the specific task role I need, which I am attempting now. I could then override the default task role created via the node tree in cdk, but this will be a fragile solution and the least preferred. Can you suggest a better way to achieve overriding the default task role that the EcsRunnerProvider creates for container use? I may also be missing something fundamental, so feel free to point that out as well. |
Replies: 2 comments 1 reply
You have access to the grant principal. You can add grants and even revokes directly. See the IAM example https://github.com/CloudSnorkel/cdk-github-runners/tree/main/examples/python/iam-permissions
The host role has permissions the tasks themselves shouldn't. That's why it's not inheriting the EC2 role. The task has its own role. |
|
I am looking at the grant principal solution now, in fact. |
You have access to the grant principal. You can add grants and even revokes directly.
See the IAM example https://github.com/CloudSnorkel/cdk-github-runners/tree/main/examples/python/iam-permissions