# IdentityType

Enum representing the different identity types that can be used for a Kubernetes service account.

- Source: [`aws-eks/lib/service-account.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-eks/lib/service-account.ts#L16)
- Type last changed: v2.148.0 · 5 Jul 2024

## Example

TypeScript:

```ts
declare const cluster: eks.Cluster;

new eks.ServiceAccount(this, 'ServiceAccount', {
  cluster,
  name: 'test-sa',
  namespace: 'default',
  identityType: eks.IdentityType.POD_IDENTITY,
});
```

Python:

```python
# cluster: eks.Cluster

eks.ServiceAccount(self, "ServiceAccount",
    cluster=cluster,
    name="test-sa",
    namespace="default",
    identity_type=eks.IdentityType.POD_IDENTITY
)
```

Java:

```java
Cluster cluster;

ServiceAccount.Builder.create(this, "ServiceAccount")
        .cluster(cluster)
        .name("test-sa")
        .namespace("default")
        .identityType(IdentityType.POD_IDENTITY)
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
Cluster cluster;

new ServiceAccount(this, "ServiceAccount", new ServiceAccountProps {
    Cluster = cluster,
    Name = "test-sa",
    Namespace = "default",
    IdentityType = IdentityType.POD_IDENTITY
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var cluster Cluster

eks.NewServiceAccount(this, jsii.String("ServiceAccount"), &ServiceAccountProps{
	Cluster: Cluster,
	Name: jsii.String("test-sa"),
	Namespace: jsii.String("default"),
	IdentityType: eks.IdentityType_POD_IDENTITY,
})
```

## Members

| Member | Description |
| --- | --- |
| `IRSA` | Use the IAM Roles for Service Accounts (IRSA) identity type. |
| `POD_IDENTITY` | Use the EKS Pod Identities identity type. |

## Referenced by

- [`ServiceAccountOptions`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_eks.ServiceAccountOptions.html).identityType
