Interface BatchJobProps
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable,TargetBaseProps
- All Known Implementing Classes:
BatchJobProps.Jsii$Proxy
@Generated(value="jsii-pacmak/1.119.0 (build 1634eac)",
date="2025-12-01T16:02:21.246Z")
@Stability(Stable)
public interface BatchJobProps
extends software.amazon.jsii.JsiiSerializable, TargetBaseProps
Customize the Batch Job Event Target.
Example:
import software.amazon.awscdk.services.ec2.*;
import software.amazon.awscdk.services.ecs.*;
import software.amazon.awscdk.services.batch.*;
import software.amazon.awscdk.services.ecs.ContainerImage;
Vpc vpc;
FargateComputeEnvironment computeEnvironment = FargateComputeEnvironment.Builder.create(this, "ComputeEnv")
.vpc(vpc)
.build();
JobQueue jobQueue = JobQueue.Builder.create(this, "JobQueue")
.priority(1)
.computeEnvironments(List.of(OrderedComputeEnvironment.builder()
.computeEnvironment(computeEnvironment)
.order(1)
.build()))
.build();
EcsJobDefinition jobDefinition = EcsJobDefinition.Builder.create(this, "MyJob")
.container(EcsEc2ContainerDefinition.Builder.create(this, "Container")
.image(ContainerImage.fromRegistry("test-repo"))
.memory(Size.mebibytes(2048))
.cpu(256)
.build())
.build();
Queue queue = new Queue(this, "Queue");
Rule rule = Rule.Builder.create(this, "Rule")
.schedule(Schedule.rate(Duration.hours(1)))
.build();
rule.addTarget(BatchJob.Builder.create(jobQueue.getJobQueueArn(), jobQueue, jobDefinition.getJobDefinitionArn(), jobDefinition)
.deadLetterQueue(queue)
.event(RuleTargetInput.fromObject(Map.of("SomeParam", "SomeValue")))
.retryAttempts(2)
.maxEventAge(Duration.hours(2))
.build());
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forBatchJobPropsstatic final classAn implementation forBatchJobProps -
Method Summary
Modifier and TypeMethodDescriptionstatic BatchJobProps.Builderbuilder()default NumberThe number of times to attempt to retry, if the job fails.default RuleTargetInputgetEvent()The event to send to the Lambda.default StringThe name of the submitted job.default NumbergetSize()The size of the array, if this is an array batch job.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJsonMethods inherited from interface software.amazon.awscdk.services.events.targets.TargetBaseProps
getDeadLetterQueue, getMaxEventAge, getRetryAttempts
-
Method Details
-
getAttempts
The number of times to attempt to retry, if the job fails.Valid values are 1–10.
Default: no retryStrategy is set
-
getEvent
The event to send to the Lambda.This will be the payload sent to the Lambda Function.
Default: the entire EventBridge event
-
getJobName
The name of the submitted job.Default: - Automatically generated
-
getSize
The size of the array, if this is an array batch job.Valid values are integers between 2 and 10,000.
Default: no arrayProperties are set
-
builder
- Returns:
- a
BatchJobProps.BuilderofBatchJobProps
-