question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

IRole vs Role types

See original GitHub issue

I’m having trouble understanding how I would import a role that has already been created, and use that role when creating a lambda function. The Role.import returns a type IRole, which is not assignable to the props when creating a Lambda function.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

13reactions
badfuncommented, Feb 11, 2021

Looks like this problem has returned. I had the exact same issue, and the “as any” fix seems to work. My error is: Type 'Role' is not assignable to type 'IRole'.

using cdk 1.89.0 (build df7253c)

0reactions
entest-haicommented, Jan 27, 2022

Same problem

aws_lambda.Function(
    role=aws_iam.Role()
)

Pylint sends a warning that ‘Role’ is not assignable to ‘IRole’

Read more comments on GitHub >

github_iconTop Results From Across the Web

AWS CDK - interface IRole
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.) ...
Read more >
awslabs/aws-cdk - Gitter
Role is the construct for creating a new resource. IRole is the interface. Importing one will give you an IRole with all the...
Read more >
IRole Interface (Microsoft.AspNet.Identity)
Defines the set of data needed to persist role information. Namespace: Microsoft.AspNet.Identity Assembly: Microsoft.AspNet.Identity.
Read more >
Interface IRole | Discord.Net Documentation
Represents a generic role object to be given to a guild user. ... This field is mutually exclusive with Icon, either icon is...
Read more >
IRole - SAP Help Portal
This interface provides read and write access to attributes and properties of instances of type IRole. IRole extends IPrincipalSet and defines additional role...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found