Skip to content

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

Open
@clayrosenthal

Description

@clayrosenthal

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

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.187.0

Environment details (OS name and version, etc.)

n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-eksRelated to Amazon Elastic Kubernetes Serviceeffort/mediumMedium work item – several days of effortfeature-requestA feature should be added or improved.p2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions