Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ecs.TaskDefinition taskRole and executionRole is not of type IRole #1925

Closed
robertd opened this issue Mar 2, 2019 · 4 comments · Fixed by #2034 · May be fixed by MechanicalRock/account-reaper#6
Closed

ecs.TaskDefinition taskRole and executionRole is not of type IRole #1925

robertd opened this issue Mar 2, 2019 · 4 comments · Fixed by #2034 · May be fixed by MechanicalRock/account-reaper#6
Labels
@aws-cdk/aws-ecs Related to Amazon Elastic Container

Comments

@robertd
Copy link
Contributor

robertd commented Mar 2, 2019

@robertd robertd changed the title ecs.FargateTaskDefinition taskRole and executionRole is not of type IRole ecs.TaskDefinition taskRole and executionRole is not of type IRole Mar 2, 2019
@sam-goodwin sam-goodwin added the @aws-cdk/aws-ecs Related to Amazon Elastic Container label Mar 4, 2019
@robertd
Copy link
Contributor Author

robertd commented Mar 7, 2019

Due to executionRole and taskRole being of Role type we are unable to assign imported roles which are of IRole type.

@robertd
Copy link
Contributor Author

robertd commented Mar 7, 2019

In my case ecs.FargateTaskDefinitionis created with imported roles (iam.Role.import()) rather than cdk creating necessary roles. I’ve tried to tackle PR myself, and it works in my case (ECS Fargate) but it breaks ESC EC2 cluster approach. I was hoping it would be an easy fix but I’m afraid that some cross-package refactoring is involved. Running build has been a struggle so I’m doing docker builds to test the code. I was just wondering if any core members can take a peek and see if the switch from using Role to IRole in aws-ecs package requires larger refactor. Thanks in advance.

@janaka
Copy link

janaka commented Mar 17, 2019

I've come across effectively the same problem in C#. Role.Import() returns Amazon.CDK.AWS.IAM.IIRole. FargateTaskDefinitionProps.ExecutionRole is type 'Amazon.CDK.AWS.IAM.Role'

rix0rrr added a commit that referenced this issue Mar 18, 2019
The role input parameters are currently Roles but should be IRoles.

Required adding the grant methods to the `IRole` definition, which
weren't there before.

Fixes #1925.
rix0rrr added a commit that referenced this issue Mar 18, 2019
The role input parameters are currently Roles but should be IRoles.

Required adding the grant methods to the `IRole` definition, which
weren't there before.

Fixes #1925.
@robertd
Copy link
Contributor Author

robertd commented Mar 18, 2019

Thank you @rix0rrr.

rix0rrr added a commit to alex-berger/aws-cdk that referenced this issue Mar 19, 2019
The role input parameters are currently Roles but should be IRoles.

Required adding the grant methods to the `IRole` definition, which
weren't there before.

Fixes aws#1925.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-ecs Related to Amazon Elastic Container
Projects
None yet
3 participants