Skip to content

Commit a6f46db

Browse files
committed
Add migration guide
1 parent eaccfed commit a6f46db

File tree

2 files changed

+33
-6
lines changed

2 files changed

+33
-6
lines changed

packages/@aws-cdk/aws-eks-v2-alpha/README.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,20 @@ bucket.grantReadWrite(serviceAccount);
840840
Note that adding service accounts requires running `kubectl` commands against the cluster which requires you to provide `kubectlProviderOptions` in the cluster props to create the `kubectl` provider. See [Kubectl Support](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-eks-v2-alpha-readme.html#kubectl-support)
841841

842842

843+
### OpenID Connect (OIDC) Provider
844+
845+
IAM OIDC identity providers are entities in IAM that describe an external identity provider (IdP) service that supports the OpenID Connect (OIDC) standard, such as Google or Salesforce. You use an IAM OIDC identity provider when you want to establish trust between an OIDC-compatible IdP and your AWS account.
846+
847+
The construct implementation has default values for thumbprints and clientIds props
848+
that will be compatible with the eks cluster.
849+
850+
```ts
851+
declare const cluster: eks.Cluster;
852+
const provider = new eks.OpenIdConnectProviderNative(this, 'OpenIdConnectProvider', {
853+
url: cluster.clusterOpenIdConnectIssuerUrl,
854+
});
855+
```
856+
843857
#### Migrating from the deprecated eks.OpenIdConnectProvider to eks.OpenIdConnectProviderNative
844858

845859
If your `eks.OpenIdConnectProvider` is created automatically via the `ServiceAccount` construct, follow these steps:
@@ -876,9 +890,9 @@ Resources
876890
2. Run `cdk deploy` to apply any pending changes. This apply the destroy/orphan changes in the above example.
877891

878892

879-
If you are creating the OpenIdConnectProvider manually via `new eks.OpenIdConnectProvider`, follow these steps:
893+
If you are creating the OpenIdConnectProvider manually via `new eks.OpenIdConnectProvider`, follow these steps to migrate to `eks.OpenIdConnectProviderNative`:
880894

881-
1. Set the `removalPolicy` of the existing `OpenIdConnectProvider` to `RemovalPolicy.RETAIN`.
895+
1. Set the `removalPolicy` of the existing `eks.OpenIdConnectProvider` to `RETAIN`.
882896

883897
```ts
884898
// Step 1: Add retain policy to existing provider
@@ -888,13 +902,13 @@ const existingProvider = new eks.OpenIdConnectProvider(this, 'Provider', {
888902
});
889903
```
890904

891-
1. Deploy with the retain policy to avoid deletion of the underlying resource.
905+
2. Deploy with the retain policy to avoid deletion of the underlying resource.
892906

893907
```bash
894908
cdk deploy
895909
```
896910

897-
1. Replace `OpenIdConnectProvider` with `OpenIdConnectProviderNative` in your code.
911+
3. Replace `OpenIdConnectProvider` with `OpenIdConnectProviderNative` in your code.
898912

899913
```ts
900914
// Step 3: Replace with native provider
@@ -903,7 +917,7 @@ const nativeProvider = new eks.OpenIdConnectProviderNative(this, 'Provider', {
903917
});
904918
```
905919

906-
1. Run `cdk diff` and verify the changes are expected. Example of an expected diff:
920+
4. Run `cdk diff` and verify the changes are expected. Example of an expected diff:
907921

908922
```bash
909923
Resources

packages/aws-cdk-lib/aws-eks/README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1459,8 +1459,21 @@ Note that adding service accounts requires running `kubectl` commands against th
14591459
This means you must also pass the `kubectlRoleArn` when importing the cluster.
14601460
See [Using existing Clusters](https://github.com/aws/aws-cdk/tree/main/packages/aws-cdk-lib/aws-eks#using-existing-clusters).
14611461

1462+
### OpenID Connect (OIDC) Provider
14621463

1463-
##### Migrating from the deprecated eks.OpenIdConnectProvider to eks.OpenIdConnectProviderNative
1464+
IAM OIDC identity providers are entities in IAM that describe an external identity provider (IdP) service that supports the OpenID Connect (OIDC) standard, such as Google or Salesforce. You use an IAM OIDC identity provider when you want to establish trust between an OIDC-compatible IdP and your AWS account.
1465+
1466+
The construct implementation has default values for thumbprints and clientIds props
1467+
that will be compatible with the eks cluster.
1468+
1469+
```ts
1470+
declare const cluster: eks.Cluster;
1471+
const provider = new eks.OpenIdConnectProviderNative(this, 'OpenIdConnectProvider', {
1472+
url: cluster.clusterOpenIdConnectIssuerUrl,
1473+
});
1474+
```
1475+
1476+
### Migrating from the deprecated eks.OpenIdConnectProvider to eks.OpenIdConnectProviderNative
14641477

14651478
If your `eks.OpenIdConnectProvider` is created via the `ServiceAccount` construct, follow these steps:
14661479

0 commit comments

Comments
 (0)