aws / aws/aws-cdk

IAM: Ability to add a clientId to an existing OpenIdConnectProvider

Open
#32,421 8 comments 0 reactions 0 assignees View on GitHub
@aws-cdk/aws-iam effort/medium feature-request p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
1d 19h
Merged PRs (30d)
71

Description

### Describe the feature

When using the OpenIdConnectProvider it would be great to be able to add ClientIds to an existing provisioned one.
The only supported methods are:
applyRemovalPolicy(policy)
toString()
static fromOpenIdConnectProviderArn(scope, id, openIdConnectProviderArn)

ref: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iam.OpenIdConnectProvider.html

### Use Case

When you use the OpenIdConnectProvider.fromOpenIdConnectProviderArn to reference an existing one, it would be really useful to be able to add additional clientIds to support more than one client using the same OIDCProvider.
We are limited in that you can only create one OIDC Providers with the same location/url per account so we end up sharing the same OIDC Provider.
Each environment would then want to add their own ClientId to the created OIDCProvider

### Proposed Solution

```ts
const oidcProvider = aws_iam.OpenIdConnectProvider.fromOpenIdConnectProviderArn(
this,
'OidcProvider',
props.oidcProviderArn,
);

oidcProvider.addClientId("GUID");

```

### Other Information

It would be good to have the clientIds as a SET so that when a clientId is added (and already there), its not duplicated in a list or breaks the deployment because already there.

### Acknowledgements

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

### CDK version used

2.133.0

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

macOS Sonoma. Version: 14.5

Contributor guide

Open the contributing guide

Research direction

Start with the OpenIdConnectProvider API and the fromOpenIdConnectProviderArn entry point described in the issue. Trace how an imported provider is represented, then define done as allowing addClientId on that reference without duplicate client IDs and verifying the resulting deployment behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
authentication, authorization, cloud
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.