Interface CfnJobDefinition.PodPropertiesProperty

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
CfnJobDefinition.PodPropertiesProperty.Jsii$Proxy
Enclosing class:
CfnJobDefinition

@Stability(Stable) public static interface CfnJobDefinition.PodPropertiesProperty extends software.amazon.jsii.JsiiSerializable
The properties for the pod.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.batch.*;
 Object labels;
 Object limits;
 Object requests;
 PodPropertiesProperty podPropertiesProperty = PodPropertiesProperty.builder()
         .containers(List.of(EksContainerProperty.builder()
                 .image("image")
                 // the properties below are optional
                 .args(List.of("args"))
                 .command(List.of("command"))
                 .env(List.of(EksContainerEnvironmentVariableProperty.builder()
                         .name("name")
                         // the properties below are optional
                         .value("value")
                         .build()))
                 .imagePullPolicy("imagePullPolicy")
                 .name("name")
                 .resources(ResourcesProperty.builder()
                         .limits(limits)
                         .requests(requests)
                         .build())
                 .securityContext(SecurityContextProperty.builder()
                         .privileged(false)
                         .readOnlyRootFilesystem(false)
                         .runAsGroup(123)
                         .runAsNonRoot(false)
                         .runAsUser(123)
                         .build())
                 .volumeMounts(List.of(EksContainerVolumeMountProperty.builder()
                         .mountPath("mountPath")
                         .name("name")
                         .readOnly(false)
                         .build()))
                 .build()))
         .dnsPolicy("dnsPolicy")
         .hostNetwork(false)
         .metadata(MetadataProperty.builder()
                 .labels(labels)
                 .build())
         .serviceAccountName("serviceAccountName")
         .volumes(List.of(EksVolumeProperty.builder()
                 .name("name")
                 // the properties below are optional
                 .emptyDir(EmptyDirProperty.builder()
                         .medium("medium")
                         .sizeLimit("sizeLimit")
                         .build())
                 .hostPath(HostPathProperty.builder()
                         .path("path")
                         .build())
                 .secret(EksSecretProperty.builder()
                         .secretName("secretName")
                         // the properties below are optional
                         .optional(false)
                         .build())
                 .build()))
         .build();
 
  • Method Details

    • getContainers

      @Stability(Stable) @Nullable default Object getContainers()
      The properties of the container that's used on the Amazon EKS pod.
    • getDnsPolicy

      @Stability(Stable) @Nullable default String getDnsPolicy()
      The DNS policy for the pod.

      The default value is ClusterFirst . If the hostNetwork parameter is not specified, the default is ClusterFirstWithHostNet . ClusterFirst indicates that any DNS query that does not match the configured cluster domain suffix is forwarded to the upstream nameserver inherited from the node. If no value was specified for dnsPolicy in the RegisterJobDefinition API operation, then no value will be returned for dnsPolicy by either of DescribeJobDefinitions or DescribeJobs API operations. The pod spec setting will contain either ClusterFirst or ClusterFirstWithHostNet , depending on the value of the hostNetwork parameter. For more information, see Pod's DNS policy in the Kubernetes documentation .

      Valid values: Default | ClusterFirst | ClusterFirstWithHostNet

    • getHostNetwork

      @Stability(Stable) @Nullable default Object getHostNetwork()
      Indicates if the pod uses the hosts' network IP address.

      The default value is true . Setting this to false enables the Kubernetes pod networking model. Most AWS Batch workloads are egress-only and don't require the overhead of IP allocation for each pod for incoming connections. For more information, see Host namespaces and Pod networking in the Kubernetes documentation .

    • getMetadata

      @Stability(Stable) @Nullable default Object getMetadata()
      CfnJobDefinition.PodPropertiesProperty.Metadata.
    • getServiceAccountName

      @Stability(Stable) @Nullable default String getServiceAccountName()
      The name of the service account that's used to run the pod.

      For more information, see Kubernetes service accounts and Configure a Kubernetes service account to assume an IAM role in the Amazon EKS User Guide and Configure service accounts for pods in the Kubernetes documentation .

    • getVolumes

      @Stability(Stable) @Nullable default Object getVolumes()
      Specifies the volumes for a job definition that uses Amazon EKS resources.
    • builder

      @Stability(Stable) static CfnJobDefinition.PodPropertiesProperty.Builder builder()
      Returns:
      a CfnJobDefinition.PodPropertiesProperty.Builder of CfnJobDefinition.PodPropertiesProperty