Skip to content
v2.278.0

EksJobDefinitionProps Struct ​

Props for EksJobDefinition.

Example ​

ts
const jobDefn = new batch.EksJobDefinition(this, 'eksf2', {
  container: new batch.EksContainerDefinition(this, 'container', {
    image: ecs.ContainerImage.fromRegistry('amazon/amazon-ecs-sample'),
    volumes: [batch.EksVolume.emptyDir({
      name: 'myEmptyDirVolume',
      mountPath: '/mount/path',
      medium: batch.EmptyDirMediumType.MEMORY,
      readonly: true,
      sizeLimit: cdk.Size.mebibytes(2048),
    })],
  }),
});
python
job_defn = batch.EksJobDefinition(self, "eksf2",
    container=batch.EksContainerDefinition(self, "container",
        image=ecs.ContainerImage.from_registry("amazon/amazon-ecs-sample"),
        volumes=[batch.EksVolume.empty_dir(
            name="myEmptyDirVolume",
            mount_path="/mount/path",
            medium=batch.EmptyDirMediumType.MEMORY,
            readonly=True,
            size_limit=cdk.Size.mebibytes(2048)
        )]
    )
)
java
EksJobDefinition jobDefn = EksJobDefinition.Builder.create(this, "eksf2")
        .container(EksContainerDefinition.Builder.create(this, "container")
                .image(ContainerImage.fromRegistry("amazon/amazon-ecs-sample"))
                .volumes(List.of(EksVolume.emptyDir(EmptyDirVolumeOptions.builder()
                        .name("myEmptyDirVolume")
                        .mountPath("/mount/path")
                        .medium(EmptyDirMediumType.MEMORY)
                        .readonly(true)
                        .sizeLimit(Size.mebibytes(2048))
                        .build())))
                .build())
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
var jobDefn = new EksJobDefinition(this, "eksf2", new EksJobDefinitionProps {
    Container = new EksContainerDefinition(this, "container", new EksContainerDefinitionProps {
        Image = ContainerImage.FromRegistry("amazon/amazon-ecs-sample"),
        Volumes = new [] { EksVolume.EmptyDir(new EmptyDirVolumeOptions {
            Name = "myEmptyDirVolume",
            MountPath = "/mount/path",
            Medium = EmptyDirMediumType.MEMORY,
            Readonly = true,
            SizeLimit = Size.Mebibytes(2048)
        }) }
    })
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
jobDefn := batch.NewEksJobDefinition(this, jsii.String("eksf2"), &EksJobDefinitionProps{
	Container: batch.NewEksContainerDefinition(this, jsii.String("container"), &EksContainerDefinitionProps{
		Image: ecs.ContainerImage_FromRegistry(jsii.String("amazon/amazon-ecs-sample")),
		Volumes: []EksVolume{
			batch.EksVolume_EmptyDir(&EmptyDirVolumeOptions{
				Name: jsii.String("myEmptyDirVolume"),
				MountPath: jsii.String("/mount/path"),
				Medium: batch.EmptyDirMediumType_MEMORY,
				Readonly: jsii.Boolean(true),
				SizeLimit: cdk.Size_Mebibytes(jsii.Number(2048)),
			}),
		},
	}),
})

Properties ​

The container this Job Definition will run.
dnsPolicyoptionalDnsPolicydns_policyoptionalDnsPolicydnsPolicyoptionalDnsPolicyDnsPolicyoptionalDnsPolicyDnsPolicyoptionalDnsPolicy = `DnsPolicy.CLUSTER_FIRST` #
The DNS Policy of the pod used by this Job Definition.
jobDefinitionNameoptionalstringjob_definition_nameoptionalstrjobDefinitionNameoptionalStringJobDefinitionNameoptionalstringJobDefinitionNameoptional*string #
The name of this job definition.

Default: generated by CloudFormation

parametersoptional{ [key: string]: any }parametersoptionaltyping.Mapping[str, Any]parametersoptionalMap<String, Object>ParametersoptionalIDictionary<string, object>Parametersoptional*map[string]interface{} = none #
The default parameters passed to the container These parameters can be referenced in the `command` that you give to the container.
retryAttemptsoptionalnumberretry_attemptsoptionalint | floatretryAttemptsoptionalNumberRetryAttemptsoptionaldoubleRetryAttemptsoptional*float64 = 1 #
The number of times to retry a job.

The job is retried on failure the same number of attempts as the value.

retryStrategiesoptionalRetryStrategy[]retry_strategiesoptionaltyping.List[RetryStrategy]retryStrategiesoptionalList<RetryStrategy>RetryStrategiesoptionalRetryStrategy[]RetryStrategiesoptional*[]RetryStrategy #
Defines the retry behavior for this job.

Default: no RetryStrategy

schedulingPriorityoptionalnumberscheduling_priorityoptionalint | floatschedulingPriorityoptionalNumberSchedulingPriorityoptionaldoubleSchedulingPriorityoptional*float64 = none #
The priority of this Job.

Only used in Fairshare Scheduling to decide which job to run first when there are multiple jobs with the same share identifier.

serviceAccountoptionalstringservice_accountoptionalstrserviceAccountoptionalStringServiceAccountoptionalstringServiceAccountoptional*string #
The name of the service account that's used to run the container.

Default: the default service account of the container

service accounts are Kubernetes method of identification and authentication, roughly analogous to IAM users.

skipDeregisterOnUpdateoptionalbooleanskip_deregister_on_updateoptionalboolskipDeregisterOnUpdateoptionalBooleanSkipDeregisterOnUpdateoptionalboolSkipDeregisterOnUpdateoptional*bool #
Specifies whether the previous revision of the job definition is retained in an active status after UPDATE events for the resource.

Default: undefined - AWS Batch default is false

When the property is set to false, the previous revision of the job definition is de-registered after a new revision is created. When the property is set to true, the previous revision of the job definition is not de-registered.

timeoutoptionalDurationtimeoutoptionalDurationtimeoutoptionalDurationTimeoutoptionalDurationTimeoutoptionalDuration #
The timeout time for jobs that are submitted with this job definition.

Default: no timeout

After the amount of time you specify passes, Batch terminates your jobs if they aren't finished.

useHostNetworkoptionalbooleanuse_host_networkoptionalbooluseHostNetworkoptionalBooleanUseHostNetworkoptionalboolUseHostNetworkoptional*bool = true #
If specified, the Pod used by this Job Definition will use the host's network IP address.

Otherwise, the Kubernetes pod networking model is enabled. Most AWS Batch workloads are egress-only and don't require the overhead of IP allocation for each pod for incoming connections.