ServiceAccountProps
- class aws_cdk.aws_eks_v2.ServiceAccountProps(*, annotations=None, identity_type=None, labels=None, name=None, namespace=None, overwrite_service_account=None, removal_policy=None, cluster)
Bases:
ServiceAccountOptionsProperties for defining service accounts.
- Parameters:
annotations (
Optional[Mapping[str,str]]) – Additional annotations of the service account. Default: - no additional annotationsidentity_type (
Optional[IdentityType]) – The identity type to use for the service account. Default: IdentityType.IRSAlabels (
Optional[Mapping[str,str]]) – Additional labels of the service account. Default: - no additional labelsname (
Optional[str]) – 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.namespace (
Optional[str]) – 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”overwrite_service_account (
Optional[bool]) – Overwrite existing service account. If this is set, we will usekubectl applyinstead ofkubectl createwhen 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: falseremoval_policy (
Optional[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.DESTROYcluster (
ICluster) – The cluster to apply the patch to.
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk as cdk from aws_cdk import aws_eks_v2 as eks_v2 # cluster: eks_v2.Cluster service_account_props = eks_v2.ServiceAccountProps( cluster=cluster, # the properties below are optional annotations={ "annotations_key": "annotations" }, identity_type=eks_v2.IdentityType.IRSA, labels={ "labels_key": "labels" }, name="name", namespace="namespace", overwrite_service_account=False, removal_policy=cdk.RemovalPolicy.DESTROY )
Attributes
- annotations
Additional annotations of the service account.
- Default:
no additional annotations
- cluster
The cluster to apply the patch to.
- identity_type
The identity type to use for the service account.
- Default:
IdentityType.IRSA
- labels
Additional labels of the service account.
- Default:
no additional labels
- name
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.
- namespace
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”
- overwrite_service_account
Overwrite existing service account.
If this is set, we will use
kubectl applyinstead ofkubectl createwhen 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
- removal_policy
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