AWS Fundamentals Logo
AWS Fundamentals
L2 Construct

ServiceAccount

Service Account.

Import

import { ServiceAccount } from 'aws-cdk-lib/aws-eks-v2';

Or use the module namespace:

import * as eks_v2 from 'aws-cdk-lib/aws-eks-v2';
// eks_v2.ServiceAccount

Properties

Configuration passed to the constructor as ServiceAccountProps.

clusterRequired
ICluster

The cluster to apply the patch to.

7 properties inherited from ServiceAccountOptions
annotationsOptionalinherited from ServiceAccountOptions
{ [key: string]: string }

Additional annotations of the service account.

Default: - no additional annotations

identityTypeOptionalinherited from ServiceAccountOptions
IdentityType

The identity type to use for the service account.

Default: IdentityType.IRSA

labelsOptionalinherited from ServiceAccountOptions
{ [key: string]: string }

Additional labels of the service account.

Default: - no additional labels

nameOptionalinherited from ServiceAccountOptions
string

The name of the service account. The name of a ServiceAccount object must be a valid DNS subdomain name. https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/

Default: - If no name is given, it will use the id of the resource.

namespaceOptionalinherited from ServiceAccountOptions
string

The namespace of the service account. All namespace names must be valid RFC 1123 DNS labels. https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/#namespaces-and-dns

Default: "default"

overwriteServiceAccountOptionalinherited from ServiceAccountOptions
boolean

Overwrite existing service account. If this is set, we will use `kubectl apply` instead of `kubectl create` when the service account is created. Otherwise, if there is already a service account in the cluster with the same name, the operation will fail.

Default: false

removalPolicyOptionalinherited from ServiceAccountOptions
RemovalPolicy

The removal policy applied to the service account resources. The removal policy controls what happens to the resources if they stop being managed by CloudFormation. This can happen in one of three situations: - The resource is removed from the template, so CloudFormation stops managing it - A change to the resource is made that requires it to be replaced, so CloudFormation stops managing it - The stack is deleted, so CloudFormation stops managing all resources in it

Default: RemovalPolicy.DESTROY

Learn AWS the Practical Way

Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.

Subscribe to Newsletter

Quick Facts

LevelL2 (Higher-level)
Moduleaws-eks-v2
Properties8

External Links