aws / aws/containers-roadmap

[EKS] [request]: Ability to extract substring from ${OIDC_PROVIDER}:sub variable when using IRSA

Open
#1,512 3 comments 7 reactions 0 assignees View on GitHub
EKS Proposed
Dominant language
Shell
Stars
5.4k
Forks
334
PR merge metrics
No merged PRs in 30d

Description

### Community Note

* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request
* Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
* If you are interested in working on this issue or have submitted a pull request, please leave a comment

**Tell us about your request**
Ability to extract substring from `${OIDC_PROVIDER}:sub` variable when using [IRSA](https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html)

**Which service(s) is this request for?**
EKS

**Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?**
I want to provide each pod with access to specific folder in S3 bucket where the folder name is automatically derived from the identity of the pod or service account name that is assigned to the pod. This way I can use a single role & policy without the need to create them per pod.
when using the `${OIDC_PROVIDER}:sub` variable in IAM policy associated with the assumed role, the returned value looks like this `system:serviceaccount::`. So all the folder names will have to have this structure. If I was able to obtain just the `namespace` or the `service account` I was able to name the S3 folders like I initially wanted.
If I could obtain a substring of the `sub` variable that would have been great. something like this:
```
"${OIDC_PROVIDER}:sub": "system:serviceaccount::"
"${OIDC_PROVIDER}:sub:namespace": ""
"${OIDC_PROVIDER}:sub:serviceaccount": ""
```

**Are you currently working around this issue?**
I need to create a dedicated role and policy per service account

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the issue’s EKS and IRSA context, including the `${OIDC_PROVIDER}:sub` value and the proposed namespace and service-account forms. This is a feature request for AWS IAM policy variable handling rather than a change tied to files or tests in the payload. Done would mean confirming support for extracting those substrings, or documenting the supported alternative.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, kubernetes
Domain
authorization, cloud
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.