Skip to content
v2.275.0

ContainerOverrides Struct ​

The overrides that should be sent to a container.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
import { aws_stepfunctions_tasks as stepfunctions_tasks } from 'aws-cdk-lib';

declare const instanceType: ec2.InstanceType;
const containerOverrides: stepfunctions_tasks.ContainerOverrides = {
  command: ['command'],
  environment: {
    environmentKey: 'environment',
  },
  gpuCount: 123,
  instanceType: instanceType,
  memory: 123,
  vcpus: 123,
};

Properties ​

commandoptionalstring[]commandoptionaltyping.List[str]commandoptionalList<String>Commandoptionalstring[]Commandoptional*[]*string#
The command to send to the container that overrides the default command from the Docker image or the job definition.

Default: No command overrides

environmentoptional{ [key: string]: string }environmentoptionaltyping.Mapping[str, str]environmentoptionalMap<String, String>EnvironmentoptionalIDictionary<string, string>Environmentoptional*map[string]*string#
The environment variables to send to the container.

Default: No environment overrides

You can add new environment variables, which are added to the container at launch, or you can override the existing environment variables from the Docker image or the job definition.

gpuCountoptionalnumbergpu_countoptionalint | floatgpuCountoptionalNumberGpuCountoptionaldoubleGpuCountoptional*float64#
The number of physical GPUs to reserve for the container.

Default: No GPU reservation

The number of GPUs reserved for all containers in a job should not exceed the number of available GPUs on the compute resource that the job is launched on.

instanceTypeoptionalInstanceTypeinstance_typeoptionalInstanceTypeinstanceTypeoptionalInstanceTypeInstanceTypeoptionalInstanceTypeInstanceTypeoptionalInstanceType#
The instance type to use for a multi-node parallel job.

Default: No instance type overrides

This parameter is not valid for single-node container jobs.

memoryoptionalnumbermemoryoptionalint | floatmemoryoptionalNumberMemoryoptionaldoubleMemoryoptional*float64#
The number of MiB of memory reserved for the job.

Default: No memory overrides

This value overrides the value set in the job definition.

vcpusoptionalnumbervcpusoptionalint | floatvcpusoptionalNumberVcpusoptionaldoubleVcpusoptional*float64#
The number of vCPUs to reserve for the container.

Default: No vCPUs overrides

This value overrides the value set in the job definition.