@Generated(value="jsii-pacmak/1.63.2 (build a8a8833)", date="2022-08-17T17:31:21.282Z") public class BatchJob extends software.amazon.jsii.JsiiObject implements IRuleTarget
Most likely the code will look something like this:
new BatchJob(jobQueue.jobQueueArn, jobQueue, jobDefinition.jobDefinitionArn, jobDefinition)
In the future this API will be improved to be fully typed
Example:
import software.amazon.awscdk.services.batch.*; import software.amazon.awscdk.services.ecs.ContainerImage; JobQueue jobQueue = JobQueue.Builder.create(this, "MyQueue") .computeEnvironments(List.of(JobQueueComputeEnvironment.builder() .computeEnvironment(ComputeEnvironment.Builder.create(this, "ComputeEnvironment") .managed(false) .build()) .order(1) .build())) .build(); JobDefinition jobDefinition = JobDefinition.Builder.create(this, "MyJob") .container(JobDefinitionContainer.builder() .image(ContainerImage.fromRegistry("test-repo")) .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());
Modifier and Type | Class and Description |
---|---|
static class |
BatchJob.Builder
A fluent builder for
BatchJob . |
IRuleTarget.Jsii$Default, IRuleTarget.Jsii$Proxy
Modifier | Constructor and Description |
---|---|
protected |
BatchJob(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
BatchJob(software.amazon.jsii.JsiiObjectRef objRef) |
|
BatchJob(java.lang.String jobQueueArn,
IConstruct jobQueueScope,
java.lang.String jobDefinitionArn,
IConstruct jobDefinitionScope) |
|
BatchJob(java.lang.String jobQueueArn,
IConstruct jobQueueScope,
java.lang.String jobDefinitionArn,
IConstruct jobDefinitionScope,
BatchJobProps props) |
Modifier and Type | Method and Description |
---|---|
RuleTargetConfig |
bind(IRule rule)
Returns a RuleTarget that can be used to trigger queue this batch job as a result from an EventBridge event.
|
RuleTargetConfig |
bind(IRule rule,
java.lang.String _id)
Returns a RuleTarget that can be used to trigger queue this batch job as a result from an EventBridge event.
|
protected BatchJob(software.amazon.jsii.JsiiObjectRef objRef)
protected BatchJob(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public BatchJob(java.lang.String jobQueueArn, IConstruct jobQueueScope, java.lang.String jobDefinitionArn, IConstruct jobDefinitionScope, BatchJobProps props)
jobQueueArn
- The JobQueue arn. This parameter is required.jobQueueScope
- The JobQueue Resource. This parameter is required.jobDefinitionArn
- The jobDefinition arn. This parameter is required.jobDefinitionScope
- The JobQueue Resource. This parameter is required.props
- public BatchJob(java.lang.String jobQueueArn, IConstruct jobQueueScope, java.lang.String jobDefinitionArn, IConstruct jobDefinitionScope)
jobQueueArn
- The JobQueue arn. This parameter is required.jobQueueScope
- The JobQueue Resource. This parameter is required.jobDefinitionArn
- The jobDefinition arn. This parameter is required.jobDefinitionScope
- The JobQueue Resource. This parameter is required.public RuleTargetConfig bind(IRule rule, java.lang.String _id)
bind
in interface IRuleTarget
rule
- This parameter is required._id
- public RuleTargetConfig bind(IRule rule)
bind
in interface IRuleTarget
rule
- This parameter is required.