Interface BatchJobProps
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
,TargetBaseProps
- All Known Implementing Classes:
BatchJobProps.Jsii$Proxy
@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)",
date="2024-10-05T03:43:43.727Z")
@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
Modifier and TypeInterfaceDescriptionstatic final class
A builder forBatchJobProps
static final class
An implementation forBatchJobProps
-
Method Summary
Modifier and TypeMethodDescriptionstatic BatchJobProps.Builder
builder()
default Number
The number of times to attempt to retry, if the job fails.default RuleTargetInput
getEvent()
The event to send to the Lambda.default String
The name of the submitted job.default Number
getSize()
The size of the array, if this is an array batch job.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
Methods 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.Builder
ofBatchJobProps
-