aws-cdk-lib.aws_batch.CfnJobDefinition.PodPropertiesProperty

interface PodPropertiesProperty

LanguageType name
.NETAmazon.CDK.AWS.Batch.CfnJobDefinition.PodPropertiesProperty
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsbatch#CfnJobDefinition_PodPropertiesProperty
Javasoftware.amazon.awscdk.services.batch.CfnJobDefinition.PodPropertiesProperty
Pythonaws_cdk.aws_batch.CfnJobDefinition.PodPropertiesProperty
TypeScript aws-cdk-lib » aws_batch » CfnJobDefinition » PodPropertiesProperty

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 { aws_batch as batch } from 'aws-cdk-lib';

declare const labels: any;
declare const limits: any;
declare const requests: any;
const podPropertiesProperty: batch.CfnJobDefinition.PodPropertiesProperty = {
  containers: [{
    image: 'image',

    // the properties below are optional
    args: ['args'],
    command: ['command'],
    env: [{
      name: 'name',

      // the properties below are optional
      value: 'value',
    }],
    imagePullPolicy: 'imagePullPolicy',
    name: 'name',
    resources: {
      limits: limits,
      requests: requests,
    },
    securityContext: {
      privileged: false,
      readOnlyRootFilesystem: false,
      runAsGroup: 123,
      runAsNonRoot: false,
      runAsUser: 123,
    },
    volumeMounts: [{
      mountPath: 'mountPath',
      name: 'name',
      readOnly: false,
    }],
  }],
  dnsPolicy: 'dnsPolicy',
  hostNetwork: false,
  metadata: {
    labels: labels,
  },
  serviceAccountName: 'serviceAccountName',
  volumes: [{
    name: 'name',

    // the properties below are optional
    emptyDir: {
      medium: 'medium',
      sizeLimit: 'sizeLimit',
    },
    hostPath: {
      path: 'path',
    },
    secret: {
      secretName: 'secretName',

      // the properties below are optional
      optional: false,
    },
  }],
};

Properties

NameTypeDescription
containers?IResolvable | IResolvable | EksContainerProperty[]The properties of the container that's used on the Amazon EKS pod.
dnsPolicy?stringThe DNS policy for the pod.
hostNetwork?boolean | IResolvableIndicates if the pod uses the hosts' network IP address.
metadata?IResolvable | MetadataPropertyCfnJobDefinition.PodPropertiesProperty.Metadata.
serviceAccountName?stringThe name of the service account that's used to run the pod.
volumes?IResolvable | IResolvable | EksVolumeProperty[]Specifies the volumes for a job definition that uses Amazon EKS resources.

containers?

Type: IResolvable | IResolvable | EksContainerProperty[] (optional)

The properties of the container that's used on the Amazon EKS pod.


dnsPolicy?

Type: string (optional)

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


hostNetwork?

Type: boolean | IResolvable (optional)

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 .


metadata?

Type: IResolvable | MetadataProperty (optional)

CfnJobDefinition.PodPropertiesProperty.Metadata.


serviceAccountName?

Type: string (optional)

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 .


volumes?

Type: IResolvable | IResolvable | EksVolumeProperty[] (optional)

Specifies the volumes for a job definition that uses Amazon EKS resources.