# AuthenticationMode

Represents the authentication mode for an Amazon EKS cluster.

- Source: [`aws-eks/lib/cluster.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-eks/lib/cluster.ts#L1189)
- Type last changed: v2.146.0 · 13 Jun 2024

## Example

TypeScript:

```ts
import { KubectlV37Layer } from '@aws-cdk/lambda-layer-kubectl-v37';
declare const vpc: ec2.Vpc;

new eks.Cluster(this, 'Cluster', {
  vpc,
  version: eks.KubernetesVersion.V1_37,
  kubectlLayer: new KubectlV37Layer(this, 'KubectlLayer'),
  authenticationMode: eks.AuthenticationMode.API_AND_CONFIG_MAP,
});
```

Python:

```python
from aws_cdk.lambda_layer_kubectl_v37 import KubectlV37Layer
# vpc: ec2.Vpc

eks.Cluster(self, "Cluster",
    vpc=vpc,
    version=eks.KubernetesVersion.V1_37,
    kubectl_layer=KubectlV37Layer(self, "KubectlLayer"),
    authentication_mode=eks.AuthenticationMode.API_AND_CONFIG_MAP
)
```

Java:

```java
import software.amazon.awscdk.cdk.lambdalayer.kubectl.v37.KubectlV37Layer;
Vpc vpc;

Cluster.Builder.create(this, "Cluster")
        .vpc(vpc)
        .version(KubernetesVersion.V1_37)
        .kubectlLayer(new KubectlV37Layer(this, "KubectlLayer"))
        .authenticationMode(AuthenticationMode.API_AND_CONFIG_MAP)
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
using Amazon.CDK.LambdaLayer.KubectlV37;
Vpc vpc;

new Cluster(this, "Cluster", new ClusterProps {
    Vpc = vpc,
    Version = KubernetesVersion.V1_37,
    KubectlLayer = new KubectlV37Layer(this, "KubectlLayer"),
    AuthenticationMode = AuthenticationMode.API_AND_CONFIG_MAP
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
import "github.com/cdklabs/awscdk-kubectl-go/kubectlv37"
var vpc Vpc

eks.NewCluster(this, jsii.String("Cluster"), &ClusterProps{
	Vpc: Vpc,
	Version: eks.KubernetesVersion_V1_37(),
	KubectlLayer: kubectlv37.NewKubectlV37Layer(this, jsii.String("KubectlLayer")),
	AuthenticationMode: eks.AuthenticationMode_API_AND_CONFIG_MAP,
})
```

## Members

| Member | Description |
| --- | --- |
| `CONFIG_MAP` | Authenticates using a Kubernetes ConfigMap. |
| `API_AND_CONFIG_MAP` | Authenticates using both the Kubernetes API server and a ConfigMap. |
| `API` | Authenticates using the Kubernetes API server. |

## Referenced by

- [`Cluster`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_eks.Cluster.html).authenticationMode
- [`ClusterOptions`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_eks.ClusterOptions.html).authenticationMode
- [`ICluster`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_eks.ICluster.html).authenticationMode
