Class ServiceAccount.Builder

java.lang.Object
software.amazon.awscdk.services.eks.ServiceAccount.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<ServiceAccount>
Enclosing class:
ServiceAccount

@Stability(Stable) public static final class ServiceAccount.Builder extends Object implements software.amazon.jsii.Builder<ServiceAccount>
A fluent builder for ServiceAccount.
  • Method Details

    • create

      @Stability(Stable) public static ServiceAccount.Builder create(software.constructs.Construct scope, String id)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      Returns:
      a new instance of ServiceAccount.Builder.
    • annotations

      @Stability(Stable) public ServiceAccount.Builder annotations(Map<String,String> annotations)
      Additional annotations of the service account.

      Default: - no additional annotations

      Parameters:
      annotations - Additional annotations of the service account. This parameter is required.
      Returns:
      this
    • identityType

      @Stability(Stable) public ServiceAccount.Builder identityType(IdentityType identityType)
      The identity type to use for the service account.

      Default: IdentityType.IRSA

      Parameters:
      identityType - The identity type to use for the service account. This parameter is required.
      Returns:
      this
    • labels

      @Stability(Stable) public ServiceAccount.Builder labels(Map<String,String> labels)
      Additional labels of the service account.

      Default: - no additional labels

      Parameters:
      labels - Additional labels of the service account. This parameter is required.
      Returns:
      this
    • name

      @Stability(Stable) public ServiceAccount.Builder name(String 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.

      Parameters:
      name - The name of the service account. This parameter is required.
      Returns:
      this
    • namespace

      @Stability(Stable) public ServiceAccount.Builder namespace(String 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"

      Parameters:
      namespace - The namespace of the service account. This parameter is required.
      Returns:
      this
    • overwriteServiceAccount

      @Stability(Stable) public ServiceAccount.Builder overwriteServiceAccount(Boolean overwriteServiceAccount)
      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

      Parameters:
      overwriteServiceAccount - Overwrite existing service account. This parameter is required.
      Returns:
      this
    • removalPolicy

      @Stability(Stable) public ServiceAccount.Builder removalPolicy(RemovalPolicy 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

      Parameters:
      removalPolicy - The removal policy applied to the service account resources. This parameter is required.
      Returns:
      this
    • cluster

      @Stability(Stable) public ServiceAccount.Builder cluster(ICluster cluster)
      The cluster to apply the patch to.

      Parameters:
      cluster - The cluster to apply the patch to. This parameter is required.
      Returns:
      this
    • build

      @Stability(Stable) public ServiceAccount build()
      Specified by:
      build in interface software.amazon.jsii.Builder<ServiceAccount>
      Returns:
      a newly built instance of ServiceAccount.