aws / aws/aws-cdk

(aws-eks): `AccessEntry` should support `IPrincipal` or `IGrantable`

Open
#34,144 3 comments 0 reactions 0 assignees View on GitHub
@aws-cdk/aws-eks @aws-cdk/aws-eks-v2-alpha effort/medium feature-request p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the feature

The AccessEntry construct currently takes `string` for the `principal` prop. This is counterintuitive when compared with the rest of CDK where similar props take an `IPrincipal`/`IGrantable`. You should be able to pass a `Role` or `User` directly to `AccessEntry` without calling `.arn` yourself.

### Use Case

I want intent based syntax, especially when using it in the context of `cluster.grantAccess()`, where in most other places you would just pass the `IPrincipal`/`IGrantable`.

### Proposed Solution

I'd love it if this was implemented overriding the old prop as it's named best for it, but I get not wanting to break backwards compatibility. I'd suggest doing that for the `eks-v2-alpha` where you are explicitly breaking backwards compatibility. For the current stable version, perhaps you could add a new prop called `grantee` that takes an `IGrantable`.

### Other Information

I'm open to discussion on whether `IGrantable` or `IPrincipal` makes more sense.

### Acknowledgements

- [x] I may be able to implement this feature request
- [x] This feature might incur a breaking change

### CDK version used

2.187.0

### Environment details (OS name and version, etc.)

n/a

Contributor guide

Open the contributing guide

Research direction

Start at the EKS AccessEntry construct and its principal prop, then compare the cluster.grantAccess() call path with existing IPrincipal/IGrantable usage. Done means allowing a Role or User directly while accounting for stable-version compatibility and the eks-v2-alpha proposal; validate the chosen API with the relevant construct tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, kubernetes, typescript
Domain
cloud, infrastructure
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.