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

aws-chatbot: addXXXPermisions() does not work #13444

Closed
aqilzeeshan opened this issue Mar 6, 2021 · 6 comments · Fixed by #13521
Closed

aws-chatbot: addXXXPermisions() does not work #13444

aqilzeeshan opened this issue Mar 6, 2021 · 6 comments · Fixed by #13521
Assignees
Labels
@aws-cdk/aws-chatbot Related to AWS Chatbot documentation This is a problem with documentation. effort/small Small work item – less than a day of effort good first issue Related to contributions. See CONTRIBUTING.md p2

Comments

@aqilzeeshan
Copy link

aqilzeeshan commented Mar 6, 2021

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

@aqilzeeshan aqilzeeshan added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Mar 6, 2021
@github-actions github-actions bot added the @aws-cdk/aws-chatbot Related to AWS Chatbot label Mar 6, 2021
@OG84
Copy link

OG84 commented Mar 6, 2021

yep just noticed the same. Documentation seems not to be in sync.
This was never implemented, if I read the pull request correctly.

@skinny85
Copy link
Contributor

skinny85 commented Mar 8, 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

@skinny85 skinny85 added documentation This is a problem with documentation. effort/small Small work item – less than a day of effort good first issue Related to contributions. See CONTRIBUTING.md p2 and removed bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Mar 8, 2021
@BLasan
Copy link
Contributor

BLasan commented 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?

@MrArnoldPalmer
Copy link
Contributor

@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.

@BLasan
Copy link
Contributor

BLasan commented Mar 10, 2021

@MrArnoldPalmer So I need to do the change in awsdocs/aws-cdk-guide right?

BLasan added a commit to BLasan/aws-cdk that referenced this issue Mar 10, 2021
BLasan added a commit to BLasan/aws-cdk that referenced this issue Mar 10, 2021
BLasan added a commit to BLasan/aws-cdk that referenced this issue Mar 10, 2021
@mergify mergify bot closed this as completed in #13521 Mar 12, 2021
mergify bot pushed a commit that referenced this issue Mar 12, 2021
…README.md (#13521)

Currently addLambdaInvokeCommandPermissions method used to get the permissions,
which is a deprecated method now.
Use addToPolicy method to get necessary permissions

fix: #13444

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

⚠️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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-chatbot Related to AWS Chatbot documentation This is a problem with documentation. effort/small Small work item – less than a day of effort good first issue Related to contributions. See CONTRIBUTING.md p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants