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

Group: addManagedPolicy is not implemented

Open github-anis-snoussi opened this issue 1 year ago • 1 comments

Describe the issue

Running the current latest version on aws-cdk-lib (2.128.0), the Group construct static method addManagedPolicy is not implemented (as can be seen here).

This is not mentioned in the documentation here and it just fails silently which is unexpected behaviour.

Proposed (temporary) solution : it should be mentioned clearly in the documentation that this method isn't implemented yet, to prevent other people banging their heads on the wall like I did 😅.

Links

https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iam.Group.html#addwbrmanagedwbrpolicypolicy https://github.com/aws/aws-cdk/blob/v2.80.0/packages/aws-cdk-lib/aws-iam/lib/group.ts#L95

github-anis-snoussi avatar Feb 21 '24 13:02 github-anis-snoussi

Yes, thank you for the callout. We should get it fixed.

pahud avatar Feb 21 '24 18:02 pahud

@ansnoussi Can you provide a stack example that I can reproduce the failure? After a bit investigation, addManagedPolicy is unimplemented for the abstract class GroupBase which is only extended by the Group class. In the Group class, addManagedPolicy is implemented and shouldn't cause any issue.

GavinZZ avatar Mar 14 '24 17:03 GavinZZ

As @GavinZZ mentioned, addManagedPolicy is not implemented because it's in the abstract class. In the extended Group class, the function is implemented. https://github.com/aws/aws-cdk/blob/v2.80.0/packages/aws-cdk-lib/aws-iam/lib/group.ts#L213

Close the issue for now. Feel free to re-open if you have any other questions.

xazhao avatar Jul 22 '24 22:07 xazhao

Comments on closed issues and PRs are hard for our team to see. If you need help, please 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.

github-actions[bot] avatar Jul 22 '24 22:07 github-actions[bot]