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-chatbot: addXXXPermisions() does not work

See original GitHub issue

Reproduction Steps

What did you expect to happen?

According to https://docs.aws.amazon.com/cdk/api/latest/docs/aws-chatbot-readme.html the following should work

slackChannel.addLambdaInvokeCommandPermissions();
slackChannel.addNotificationPermissions();
slackChannel.addSupportCommandPermissions();
slackChannel.addReadOnlyCommandPermissions();

What actually happened?

3

Environment

  • **CDK CLI Version :*1.91.0 *
  • **Framework Version:*1.91.0 *
  • **Node.js Version:v10.24.0
  • **OS :Amazon Linux AMI 2018.03
  • **Language (Version):TypeScript Version 3.7.5

Other

Of course I can do it long way as shown below but it would be nice to reduce lines of code if above works.

    const lambdaInvokeCommandStatement = new iam.PolicyStatement({
      effect: iam.Effect.ALLOW,
      resources: ['*'],
      actions: [
        "lambda:invokeAsync",
        "lambda:invokeFunction"
      ],
    });
    slackChannel.addToRolePolicy(lambdaInvokeCommandStatement);

This is 🐛 Bug Report

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
MrArnoldPalmercommented, Mar 10, 2021

@BLasan whoever wants to pick it is welcome. Yeah it’s just replacing references in the docs to the old methods with usage of addToResourcePolicy.

1reaction
BLasancommented, Mar 10, 2021

Hey @aqilzeeshan ,

yes, this is an error in the documentation. These were removed from the original PR, in favor of just having the addToRolePolicy method.

Any chance of a PR fixing the docs? Here’s our Contributing guide: https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md.

Thanks, Adam

Can I work on this? Basically we need to replace slackChannel.addLambdaInvokeCommandPermissions(); with slackChannel.addToRolePolicy(lambdaInvokeCommandStatement); right?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting AWS Chatbot
If the topic doesn't, open the AWS Chatbot console, open your authorized client, and then look at the Configured channels or Configured webhooks...
Read more >
Troubleshooting AWS Chatbot identity and access
Use the following information to help you diagnose and fix common issues that you might encounter when working with AWS Chatbot and IAM....
Read more >
IAM resource-level permissions for AWS Chatbot
Resource-level permissions define the AWS resources on which you allow assigned entities (users, groups, and roles) to perform actions.
Read more >
Understanding AWS Chatbot permissions
Open the AWS Chatbot console at https://console.aws.amazon.com/chatbot/ . Choose the configured client, and choose the name of the configured channel or ...
Read more >
Identity and Access Management for AWS Chatbot
To get a high-level view of how AWS Chatbot and other AWS services work with IAM, see AWS Services ... The permissions determine...
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