ServiceAccountProps Struct
Properties for defining service accounts.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_eks_v2 as eks_v2 } from 'aws-cdk-lib';
declare const cluster: eks_v2.Cluster;
const serviceAccountProps: eks_v2.ServiceAccountProps = {
cluster: cluster,
// the properties below are optional
annotations: {
annotationsKey: 'annotations',
},
identityType: eks_v2.IdentityType.IRSA,
labels: {
labelsKey: 'labels',
},
name: 'name',
namespace: 'namespace',
overwriteServiceAccount: false,
removalPolicy: cdk.RemovalPolicy.DESTROY,
};
Properties
annotations{ [key: string]: string }annotationstyping.Mapping[str, str]annotationsMap<String, String>AnnotationsIDictionary<string, string>Annotations*map[string]*string= no additional annotations#identityTypeIdentityTypeidentity_typeIdentityTypeidentityTypeIdentityTypeIdentityTypeIdentityTypeIdentityTypeIdentityType= IdentityType.IRSA#labels{ [key: string]: string }labelstyping.Mapping[str, str]labelsMap<String, String>LabelsIDictionary<string, string>Labels*map[string]*string= no additional labels#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
Default: If no name is given, it will use the id of the resource.
All namespace names must be valid RFC 1123 DNS labels. https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/#namespaces-and-dns
overwriteServiceAccountbooleanoverwrite_service_accountbooloverwriteServiceAccountBooleanOverwriteServiceAccountboolOverwriteServiceAccount*bool= false#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.
removalPolicyRemovalPolicyremoval_policyRemovalPolicyremovalPolicyRemovalPolicyRemovalPolicyRemovalPolicyRemovalPolicyRemovalPolicy= RemovalPolicy.DESTROY#notes
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