ServiceAccountOptions

class aws_cdk.aws_eks_v2_alpha.ServiceAccountOptions(*, annotations=None, identity_type=None, labels=None, name=None, namespace=None, overwrite_service_account=None, removal_policy=None)

Bases: object

(experimental) Options for ServiceAccount.

Parameters:
  • annotations (Optional[Mapping[str, str]]) – (experimental) Additional annotations of the service account. Default: - no additional annotations

  • identity_type (Optional[IdentityType]) – (experimental) The identity type to use for the service account. Default: IdentityType.IRSA

  • labels (Optional[Mapping[str, str]]) – (experimental) Additional labels of the service account. Default: - no additional labels

  • name (Optional[str]) – (experimental) 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]) – (experimental) 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]) – (experimental) 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

  • removal_policy (Optional[RemovalPolicy]) – (experimental) 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

Stability:

experimental

ExampleMetadata:

infused

Example:

# cluster: eks.Cluster

# add service account with annotations and labels
service_account = cluster.add_service_account("MyServiceAccount",
    annotations={
        "eks.amazonaws.com/sts-regional-endpoints": "false"
    },
    labels={
        "some-label": "with-some-value"
    }
)

Attributes

annotations

(experimental) Additional annotations of the service account.

Default:
  • no additional annotations

Stability:

experimental

identity_type

(experimental) The identity type to use for the service account.

Default:

IdentityType.IRSA

Stability:

experimental

labels

(experimental) Additional labels of the service account.

Default:
  • no additional labels

Stability:

experimental

name

(experimental) 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.

Stability:

experimental

namespace

(experimental) 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”

Stability:

experimental

overwrite_service_account

(experimental) 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

Stability:

experimental

removal_policy

(experimental) 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

Stability:

experimental