aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.33k stars 3.76k forks source link

(cognito): UserPoolGroup CDK construct #21026

Open SamStephens opened 1 year ago

SamStephens commented 1 year ago

Describe the feature

Provide a high level construct for Cognito user pool groups.

Use Case

If we want to use CDK to create Cognito Groups, we have to use Level 1/Cfn constructs.

Proposed Solution

Create a high-level CDK Construct for AWS::Cognito::UserPoolGroup. Possibly also add an add_group method to UserPool.

Other Information

Reopening the recently auto-closed issue https://github.com/aws/aws-cdk/issues/13413.

Acknowledgements

CDK version used

2.31.0, Python

Environment details (OS name and version, etc.)

Ubuntu 20.04 on WSL 2 within Windows 10.0.19044

corymhall commented 1 year ago

This issue has been classified as p2. That means a workaround is available or it is deemed a nice-to-have feature. Given the amount of work there is to do and the relative priority of this issue, the CDK team is unlikely to address it. That does not mean the issue will never be fixed! If someone from the community submits a PR to fix this issue, and the PR is small and straightforward enough, and meets the quality bars to be reviewed and merged with little effort we will accept that PR. PRs that do not build or need complex or multiple rounds of reviews are unlikely to be merged and will be closed to keep our backlog manageable.

In the mean time, remember that you can always use the escape hatch (https://docs.aws.amazon.com/cdk/v2/guide/cfn_layer.html) mechanism to have fine control over the CloudFormation output you want. We will keep the issue open for discoverability, to collect upvotes, and to facilitate discussion around this topic.

We use +1s on this issue to help prioritize our work, and are happy to re-evaluate the prioritization of this issue based on community feedback. You can reach out to the cdk.dev community on Slack (https://cdk.dev/) to solicit support for reprioritization.

@SamStephens it looks like you may be interested in contributing this feature. It looks like UserPoolGroup may be a pretty straightforward construct, but if it ends up being more complicated I would recommend starting the PR with just the README changes so that we can agree on the design before starting on the implementation.

vumdao commented 1 year ago

Using CfnUserPoolGroup is ok but hope we can use L2 at all

0xdevalias commented 1 year ago

CfnUserPoolGroup Example:

const cfnFooGroup = new CfnUserPoolGroup(this, 'FooUserGroup', {
  userPoolId: userPool.userPoolId,
  groupName: `${userPool.userPoolId}_Foo`,
  description: 'Group for users who were registered through Foo',
})