elasticache: remove `userName` property from `IamUser` construct
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 83
Description
### Describe the feature
For IAM-enabled ElastiCache users the username and user id properties must be identical. [Ref](https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/auth-iam.html#:~:text=For%20IAM%2Denabled%20ElastiCache%20users%20the%20username%20and%20user%20id%20properties%20must%20be%20identical.)
In the current L2 Construct, both username and user id can be configured, and validation throws an error if they don't match.
https://github.com/aws/aws-cdk/blob/main/packages/%40aws-cdk/aws-elasticache-alpha/lib/iam-user.ts#L91
It would be more user-friendly to make the user name property non-configurable and automatically set it to match the user id value.
### Use Case
When use `IamUser` Construct.
### Proposed Solution
* remove `userName` property from the `IamUser` Construct
* automatically set the `userId` value to `userName` in the Construct
### Other Information
_No response_
### Acknowledgements
- [x] I may be able to implement this feature request
- [x] This feature might incur a breaking change
### AWS CDK Library version (aws-cdk-lib)
all
### AWS CDK CLI version
all
### Environment details (OS name and version, etc.)
all
Contributor guide
Research direction
The relevant construct is packages/@aws-cdk/aws-elasticache-alpha/lib/iam-user.ts around line 91; start by reading the IamUser properties and validation there. Confirm the public API no longer accepts userName and that the username matches userId, then check the construct's existing tests for the updated behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, typescript
- Domain
- cloud, infrastructure
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100