aws-cdk-lib.aws_batch.CfnJobDefinition.EksContainerProperty

interface EksContainerProperty

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

EKS container properties are used in job definitions for Amazon EKS based job definitions to describe the properties for a container node in the pod that's launched as part of a job.

This can't be specified for Amazon ECS based job definitions.

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 limits: any;
declare const requests: any;
const eksContainerProperty: batch.CfnJobDefinition.EksContainerProperty = {
  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,
  }],
};

Properties

NameTypeDescription
imagestringThe Docker image used to start the container.
args?string[]An array of arguments to the entrypoint.
command?string[]The entrypoint for the container.
env?IResolvable | IResolvable | EksContainerEnvironmentVariableProperty[]The environment variables to pass to a container.
imagePullPolicy?stringThe image pull policy for the container.
name?stringThe name of the container.
resources?IResolvable | ResourcesPropertyThe type and amount of resources to assign to a container.
securityContext?IResolvable | SecurityContextPropertyCfnJobDefinition.EksContainerProperty.SecurityContext.
volumeMounts?IResolvable | IResolvable | EksContainerVolumeMountProperty[]The volume mounts for the container.

image

Type: string

The Docker image used to start the container.


args?

Type: string[] (optional)

An array of arguments to the entrypoint.

If this isn't specified, the CMD of the container image is used. This corresponds to the args member in the Entrypoint portion of the Pod in Kubernetes. Environment variable references are expanded using the container's environment.

If the referenced environment variable doesn't exist, the reference in the command isn't changed. For example, if the reference is to " $(NAME1) " and the NAME1 environment variable doesn't exist, the command string will remain " $(NAME1) ." $$ is replaced with $ , and the resulting string isn't expanded. For example, $$(VAR_NAME) is passed as $(VAR_NAME) whether or not the VAR_NAME environment variable exists. For more information, see CMD in the Dockerfile reference and Define a command and arguments for a pod in the Kubernetes documentation .


command?

Type: string[] (optional)

The entrypoint for the container.

This isn't run within a shell. If this isn't specified, the ENTRYPOINT of the container image is used. Environment variable references are expanded using the container's environment.

If the referenced environment variable doesn't exist, the reference in the command isn't changed. For example, if the reference is to " $(NAME1) " and the NAME1 environment variable doesn't exist, the command string will remain " $(NAME1) ." $$ is replaced with $ and the resulting string isn't expanded. For example, $$(VAR_NAME) will be passed as $(VAR_NAME) whether or not the VAR_NAME environment variable exists. The entrypoint can't be updated. For more information, see ENTRYPOINT in the Dockerfile reference and Define a command and arguments for a container and Entrypoint in the Kubernetes documentation .


env?

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

The environment variables to pass to a container.

Environment variables cannot start with " AWS_BATCH ". This naming convention is reserved for variables that AWS Batch sets.


imagePullPolicy?

Type: string (optional)

The image pull policy for the container.

Supported values are Always , IfNotPresent , and Never . This parameter defaults to IfNotPresent . However, if the :latest tag is specified, it defaults to Always . For more information, see Updating images in the Kubernetes documentation .


name?

Type: string (optional)

The name of the container.

If the name isn't specified, the default name " Default " is used. Each container in a pod must have a unique name.


resources?

Type: IResolvable | ResourcesProperty (optional)

The type and amount of resources to assign to a container.

The supported resources include memory , cpu , and nvidia.com/gpu . For more information, see Resource management for pods and containers in the Kubernetes documentation .


securityContext?

Type: IResolvable | SecurityContextProperty (optional)

CfnJobDefinition.EksContainerProperty.SecurityContext.


volumeMounts?

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

The volume mounts for the container.

AWS Batch supports emptyDir , hostPath , and secret volume types. For more information about volumes and volume mounts in Kubernetes, see Volumes in the Kubernetes documentation .