aws-cdk icon indicating copy to clipboard operation
aws-cdk copied to clipboard

IRole vs Role types in aws_apigateway.IntegrationOptions

Open guangyuzh opened this issue 7 years ago • 2 comments

Note: for support questions, please first reference our documentation, then use Stackoverflow. This repository's issues are intended for feature requests and bug reports.

  • I'm submitting a ...

    • [x] :beetle: bug report
    • [ ] :rocket: feature request
    • [ ] :books: construct library gap
    • [ ] :phone: security issue or vulnerability => Please see policy
    • [ ] :question: support request => Please see note at the top of this template.
  • What is the current behavior? If the current behavior is a :beetle:bug:beetle:: Please provide the steps to reproduce

I'm trying to take an existing IAM Role when integrating API Gateway with AWS services.

However, aws_iam.Role.from_role_arn(...) returns aws_cdk.aws_iam.IRole, while the credentials_role in aws_apigateway.IntegrationOptions(...) only takes aws_cdk.aws_iam.Role.

  • What is the expected behavior (or behavior of feature suggested)? aws_apigateway.IntegrationOptions(...) should take aws_cdk.aws_iam.IRole as the input type

  • What is the motivation / use case for changing the behavior or adding this feature? Fix bug.

Otherwise, cannot reuse some existing IAM Role.

  • Please tell us about your environment:

    • CDK CLI Version: 1.0.0
    • Module Version: 1.0.0
    • OS: [all | Windows 10 | OSX Mojave | Ubuntu | etc... ]
    • Language: [Python ]
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. associated pull-request, stackoverflow, gitter, etc)

jsii.errors.JSIIError: Object of type @aws-cdk/aws-iam.IRole is not convertible to @aws-cdk/aws-iam.Role

guangyuzh avatar Jul 08 '19 22:07 guangyuzh

Bug still exists in the latest 1.0.0 version.

guangyuzh avatar Jul 16 '19 21:07 guangyuzh

@guangyuzh does this help you? https://github.com/aws/aws-cdk/pull/3369

sgrinich-98point6 avatar Aug 21 '19 18:08 sgrinich-98point6