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.

(aws-cdk): role parameter disappeared from CustomResources::Provider

See original GitHub issue

Documentation says (https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_custom-resources.Provider.html) that Provider has a “role” parameter. But trying to use an example from the doc leads to

  File "/work/cdk/cdk/provisioners/eks/eks_cluster.py", line 71, in provision
    my_provider = cr.Provider(self, "MyProvider",
  File "/work/cdk/cdk/.venv/lib/python3.9/site-packages/jsii/_runtime.py", line 83, in __call__
    inst = super().__call__(*args, **kwargs)
TypeError: __init__() got an unexpected keyword argument 'role'

Reproduction Steps

Just try first example in the docs https://docs.aws.amazon.com/cdk/api/latest/python/aws_cdk.custom_resources/README.html

What did you expect to happen?

The example should work.

What actually happened?

TypeError: __init__() got an unexpected keyword argument 'role'

Environment

  • CDK CLI Version : 1.109
  • Framework Version:
  • Node.js Version: v16.0.0
  • OS : macOs
  • Language (Version): Python 3.9.4

Other

Without a role parameter is is impossible to give a lambda permissions to perform the required operations. When AwsCustomResource can figure out permissions from the actions, Provider with lambda in the external code has no such possibility.


This is 🐛 Bug Report

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ddl-denis-parnovskiycommented, Jun 28, 2021

After completely uninstalling node and npm and reinstalling everything from scratch, the example finally works.

0reactions
github-actions[bot]commented, Jun 28, 2021

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Managing Missing CloudFormation Support with the AWS CDK
In this post I'll introduce the AWS SDK Custom Resource wrappers provided by the AWS CDK, which ease the creation of safe Custom...
Read more >
aws-cdk/custom-resources module - AWS Documentation
Implements default behavior for physical resource IDs. The following code shows how the Provider construct is used in conjunction with a CustomResource and...
Read more >
Delete Lambda-backed custom resources stuck in ...
Delete a custom resource that's stuck in DELETE_IN_PROGRESS status ; Functions, and then choose the function that you identified in step 1. For ......
Read more >
class KubectlProvider (construct) · AWS CDK
Implements IConstruct , IConstruct , IDependable , ITaggable , IKubectlProvider. Implementation of Kubectl Lambda. Example. const handlerRole = iam.
Read more >
Runtime context - AWS Cloud Development Kit (AWS CDK) v2
Get information about the runtime context through context providers. ... Gets a value from the current Region's Amazon EC2 Systems Manager Parameter Store....
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