Skip to content

Conversation

pahud
Copy link
Contributor

@pahud pahud commented Sep 29, 2025

Issue # (if applicable)

Related to #35607.

Reason for this change

follow the established pattern and consistency using this.getResourceNameAttribute(resource.ref); to get resource name.

Description of changes

Fixed the UserPoolGroup.groupName property to use the established CDK pattern getResourceNameAttribute() instead of directly assigning the CloudFormation resource reference.

  • Changed this.groupName = resource.ref to this.groupName = this.getResourceNameAttribute(resource.ref) in user-pool-group.ts line 127
  • This follows the same pattern used consistently across CDK constructs (S3 Bucket, all Cognito Identity Providers)
  • Maintains CloudFormation functionality while enabling proper programmatic access to the group name
  • Added comprehensive unit tests to validate the fix behavior (as this is an established pattern, I am fine if we agree remove the tests)

The fix enables developers to use userPoolGroup.groupName for programmatic operations while preserving all existing CloudFormation template generation behavior.

Describe any new or updated permissions being added

N/A - No IAM permissions or resource access changes.

Description of how you validated changes

  • Unit tests: Added 4 comprehensive unit tests in user-pool-group.test.ts that validate:
    • CloudFormation token behavior in same environment
    • Generated name handling when groupName not explicitly set
    • CDK pattern consistency with other constructs
    • CloudFormation template correctness
  • Integration tests: Existing integration test continues to pass unchanged, confirming CloudFormation template generation remains identical
  • Build verification: All TypeScript compilation, linting, and build checks pass

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@aws-cdk-automation aws-cdk-automation requested a review from a team September 29, 2025 19:09
@github-actions github-actions bot added the p2 label Sep 29, 2025
@pahud pahud marked this pull request as ready for review September 29, 2025 19:09
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Sep 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS. p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant