How IRSA Works
OIDC provider is created
The module creates an
aws_iam_openid_connect_provider resource backed by the EKS cluster’s OIDC issuer URL. This is enabled by default via enable_irsa = true.IAM role is configured to trust the provider
You create an IAM role with a trust policy that allows the OIDC provider to assume it, scoped to a specific Kubernetes service account.
Service account is annotated
The Kubernetes service account is annotated with the IAM role ARN. The EKS pod identity webhook injects credentials into pods using that service account.
For new clusters, consider using EKS Pod Identity instead of IRSA. Pod Identity does not require annotating service accounts with role ARNs and simplifies the trust policy configuration.
Enabling IRSA
IRSA is enabled by default. The module creates the OIDC provider automatically whenenable_irsa = true.
OIDC Provider Outputs
After applying, the module exposes the OIDC provider details as outputs:| Output | Description |
|---|---|
oidc_provider | The OIDC provider URL (without https:// prefix) |
oidc_provider_arn | Full ARN of the IAM OIDC provider resource |
cluster_oidc_issuer_url | The full OIDC issuer URL with https:// prefix |
cluster_dualstack_oidc_issuer_url | Dual-stack OIDC issuer URL (for IPv6 clusters) |
Creating a Service Account IAM Role
Use the module outputs to build the trust policy for your service account IAM roles. The trust policy must reference the OIDC provider ARN and scope to the specific namespace and service account.Custom OIDC Audiences
By default, the OIDC provider audience issts.amazonaws.com. Add additional client IDs (audiences) with openid_connect_audiences:
Custom OIDC Thumbprints
The module automatically retrieves the root CA thumbprint for the OIDC issuer (controlled byinclude_oidc_root_ca_thumbprint = true). To add additional thumbprints — for example during a certificate rotation — use custom_oidc_thumbprints:
Dual-Stack OIDC (IPv6 Clusters)
For IPv6 clusters, use thecluster_dualstack_oidc_issuer_url output instead of cluster_oidc_issuer_url to build trust policies. This URL supports both IPv4 and IPv6 clients.
IRSA Variable Reference
| Variable | Type | Default | Description |
|---|---|---|---|
enable_irsa | bool | true | Create the IAM OIDC provider for the cluster |
openid_connect_audiences | list(string) | [] | Additional audience client IDs for the OIDC provider |
include_oidc_root_ca_thumbprint | bool | true | Automatically retrieve and include the root CA thumbprint |
custom_oidc_thumbprints | list(string) | [] | Additional certificate thumbprints to trust |
