ServiceAccountProps Struct
Properties for defining service accounts.
Example
declare const cluster: eks.Cluster;
new eks.ServiceAccount(this, 'ServiceAccount', {
cluster,
name: 'test-sa',
namespace: 'default',
identityType: eks.IdentityType.POD_IDENTITY,
});
# cluster: eks.Cluster
eks.ServiceAccount(self, "ServiceAccount",
cluster=cluster,
name="test-sa",
namespace="default",
identity_type=eks.IdentityType.POD_IDENTITY
)
Cluster cluster;
ServiceAccount.Builder.create(this, "ServiceAccount")
.cluster(cluster)
.name("test-sa")
.namespace("default")
.identityType(IdentityType.POD_IDENTITY)
.build();
// 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
});
// 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,
})
Properties
annotationsoptional{ [key: string]: string }annotationsoptionaltyping.Mapping[str, str]annotationsoptionalMap<String, String>AnnotationsoptionalIDictionary<string, string>Annotationsoptional*map[string]*string#Default: no additional annotations
identityTypeoptionalIdentityTypeidentity_typeoptionalIdentityTypeidentityTypeoptionalIdentityTypeIdentityTypeoptionalIdentityTypeIdentityTypeoptionalIdentityType= IdentityType.IRSA#labelsoptional{ [key: string]: string }labelsoptionaltyping.Mapping[str, str]labelsoptionalMap<String, String>LabelsoptionalIDictionary<string, string>Labelsoptional*map[string]*string#Default: no additional labels
Default: If no name is given, it will use the id of the resource.
The name of a ServiceAccount object must be a valid DNS subdomain name. https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
namespaceoptionalstringnamespaceoptionalstrnamespaceoptionalStringNamespaceoptionalstringNamespaceoptional*string= "default"#All namespace names must be valid RFC 1123 DNS labels. https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/#namespaces-and-dns
overwriteServiceAccountoptionalbooleanoverwrite_service_accountoptionalbooloverwriteServiceAccountoptionalBooleanOverwriteServiceAccountoptionalboolOverwriteServiceAccountoptional*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.
removalPolicyoptionalRemovalPolicyremoval_policyoptionalRemovalPolicyremovalPolicyoptionalRemovalPolicyRemovalPolicyoptionalRemovalPolicyRemovalPolicyoptionalRemovalPolicy= 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