software.amazon.awscdk.services.pipes.sources.alpha.DynamoDBSource Maven / Gradle / Ivy
Show all versions of pipes-sources-alpha Show documentation
package software.amazon.awscdk.services.pipes.sources.alpha;
/**
* (experimental) A source that reads from an DynamoDB stream.
*
* Example:
*
*
* Queue targetQueue;
* TableV2 table = TableV2.Builder.create(this, "MyTable")
* .partitionKey(Attribute.builder()
* .name("id")
* .type(AttributeType.STRING)
* .build())
* .dynamoStream(StreamViewType.NEW_IMAGE)
* .build();
* DynamoDBSource pipeSource = DynamoDBSource.Builder.create(table)
* .startingPosition(DynamoDBStartingPosition.LATEST)
* .build();
* Pipe pipe = Pipe.Builder.create(this, "Pipe")
* .source(pipeSource)
* .target(new SqsTarget(targetQueue))
* .build();
*
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.104.0 (build e79254c)", date = "2024-11-13T21:17:43.518Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.pipes.sources.alpha.$Module.class, fqn = "@aws-cdk/aws-pipes-sources-alpha.DynamoDBSource")
public class DynamoDBSource extends software.amazon.awscdk.services.pipes.sources.alpha.StreamSource {
protected DynamoDBSource(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected DynamoDBSource(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* @param table This parameter is required.
* @param parameters This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public DynamoDBSource(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.dynamodb.ITableV2 table, final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.pipes.sources.alpha.DynamoDBSourceParameters parameters) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(table, "table is required"), java.util.Objects.requireNonNull(parameters, "parameters is required") });
}
/**
* (experimental) Bind the source to a pipe.
*
* @param _pipe This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.pipes.alpha.SourceConfig bind(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.pipes.alpha.IPipe _pipe) {
return software.amazon.jsii.Kernel.call(this, "bind", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.pipes.alpha.SourceConfig.class), new Object[] { java.util.Objects.requireNonNull(_pipe, "_pipe is required") });
}
/**
* (experimental) Grant the pipe role read access to the source.
*
* @param grantee This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public void grantRead(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.iam.IRole grantee) {
software.amazon.jsii.Kernel.call(this, "grantRead", software.amazon.jsii.NativeType.VOID, new Object[] { java.util.Objects.requireNonNull(grantee, "grantee is required") });
}
/**
* (experimental) A fluent builder for {@link software.amazon.awscdk.services.pipes.sources.alpha.DynamoDBSource}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
/**
* @return a new instance of {@link Builder}.
* @param table This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static Builder create(final software.amazon.awscdk.services.dynamodb.ITableV2 table) {
return new Builder(table);
}
private final software.amazon.awscdk.services.dynamodb.ITableV2 table;
private final software.amazon.awscdk.services.pipes.sources.alpha.DynamoDBSourceParameters.Builder parameters;
private Builder(final software.amazon.awscdk.services.dynamodb.ITableV2 table) {
this.table = table;
this.parameters = new software.amazon.awscdk.services.pipes.sources.alpha.DynamoDBSourceParameters.Builder();
}
/**
* (experimental) The maximum number of records to include in each batch.
*
* Default: 1
*
* @return {@code this}
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-pipes-pipe-pipesourcekinesisstreamparameters.html#cfn-pipes-pipe-pipesourcekinesisstreamparameters-batchsize
* @param batchSize The maximum number of records to include in each batch. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder batchSize(final java.lang.Number batchSize) {
this.parameters.batchSize(batchSize);
return this;
}
/**
* (experimental) Define the target to send dead-letter queue events to.
*
* The dead-letter queue stores any events that are not successfully delivered to a Pipes target after all retry attempts are exhausted.
* You can then resolve the issue that caused the failed invocations and replay the events at a later time.
* In some cases, such as when access is denied to a resource, events are sent directly to the dead-letter queue and are not retried.
*
* Default: - no dead-letter queue or topic
*
* @return {@code this}
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-pipes-pipe-pipesourcekinesisstreamparameters.html#cfn-pipes-pipe-pipesourcekinesisstreamparameters-deadletterconfig
* @param deadLetterTarget Define the target to send dead-letter queue events to. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder deadLetterTarget(final software.amazon.awscdk.services.sqs.IQueue deadLetterTarget) {
this.parameters.deadLetterTarget(deadLetterTarget);
return this;
}
/**
* (experimental) Define the target to send dead-letter queue events to.
*
* The dead-letter queue stores any events that are not successfully delivered to a Pipes target after all retry attempts are exhausted.
* You can then resolve the issue that caused the failed invocations and replay the events at a later time.
* In some cases, such as when access is denied to a resource, events are sent directly to the dead-letter queue and are not retried.
*
* Default: - no dead-letter queue or topic
*
* @return {@code this}
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-pipes-pipe-pipesourcekinesisstreamparameters.html#cfn-pipes-pipe-pipesourcekinesisstreamparameters-deadletterconfig
* @param deadLetterTarget Define the target to send dead-letter queue events to. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder deadLetterTarget(final software.amazon.awscdk.services.sns.ITopic deadLetterTarget) {
this.parameters.deadLetterTarget(deadLetterTarget);
return this;
}
/**
* (experimental) The maximum length of a time to wait for events.
*
* Default: - the events will be handled immediately
*
* @return {@code this}
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-pipes-pipe-pipesourcekinesisstreamparameters.html#cfn-pipes-pipe-pipesourcekinesisstreamparameters-maximumbatchingwindowinseconds
* @param maximumBatchingWindow The maximum length of a time to wait for events. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder maximumBatchingWindow(final software.amazon.awscdk.Duration maximumBatchingWindow) {
this.parameters.maximumBatchingWindow(maximumBatchingWindow);
return this;
}
/**
* (experimental) Discard records older than the specified age.
*
* The default value is -1, which sets the maximum age to infinite. When the value is set to infinite, EventBridge never discards old records.
*
* Default: -1 - EventBridge won't discard old records
*
* @return {@code this}
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-pipes-pipe-pipesourcekinesisstreamparameters.html#cfn-pipes-pipe-pipesourcekinesisstreamparameters-maximumrecordageinseconds
* @param maximumRecordAge Discard records older than the specified age. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder maximumRecordAge(final software.amazon.awscdk.Duration maximumRecordAge) {
this.parameters.maximumRecordAge(maximumRecordAge);
return this;
}
/**
* (experimental) Discard records after the specified number of retries.
*
* The default value is -1, which sets the maximum number of retries to infinite. When MaximumRetryAttempts is infinite, EventBridge retries failed records until the record expires in the event source.
*
* Default: -1 - EventBridge will retry failed records until the record expires in the event source
*
* @return {@code this}
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-pipes-pipe-pipesourcekinesisstreamparameters.html#cfn-pipes-pipe-pipesourcekinesisstreamparameters-maximumretryattempts
* @param maximumRetryAttempts Discard records after the specified number of retries. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder maximumRetryAttempts(final java.lang.Number maximumRetryAttempts) {
this.parameters.maximumRetryAttempts(maximumRetryAttempts);
return this;
}
/**
* (experimental) Define how to handle item process failures.
*
* {@link OnPartialBatchItemFailure.AUTOMATIC_BISECT} halves each batch and will retry each half until all the records are processed or there is one failed message left in the batch.
*
* Default: off - EventBridge will retry the entire batch
*
* @return {@code this}
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-pipes-pipe-pipesourcekinesisstreamparameters.html#cfn-pipes-pipe-pipesourcekinesisstreamparameters-onpartialbatchitemfailure
* @param onPartialBatchItemFailure Define how to handle item process failures. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder onPartialBatchItemFailure(final software.amazon.awscdk.services.pipes.sources.alpha.OnPartialBatchItemFailure onPartialBatchItemFailure) {
this.parameters.onPartialBatchItemFailure(onPartialBatchItemFailure);
return this;
}
/**
* (experimental) The number of batches to process concurrently from each shard.
*
* Default: 1
*
* @return {@code this}
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-pipes-pipe-pipesourcekinesisstreamparameters.html#cfn-pipes-pipe-pipesourcekinesisstreamparameters-parallelizationfactor
* @param parallelizationFactor The number of batches to process concurrently from each shard. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder parallelizationFactor(final java.lang.Number parallelizationFactor) {
this.parameters.parallelizationFactor(parallelizationFactor);
return this;
}
/**
* (experimental) The position in a stream from which to start reading.
*
* @return {@code this}
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-pipes-pipe-pipesourcedynamodbstreamparameters.html#cfn-pipes-pipe-pipesourcedynamodbstreamparameters-startingposition
* @param startingPosition The position in a stream from which to start reading. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder startingPosition(final software.amazon.awscdk.services.pipes.sources.alpha.DynamoDBStartingPosition startingPosition) {
this.parameters.startingPosition(startingPosition);
return this;
}
/**
* @return a newly built instance of {@link software.amazon.awscdk.services.pipes.sources.alpha.DynamoDBSource}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public software.amazon.awscdk.services.pipes.sources.alpha.DynamoDBSource build() {
return new software.amazon.awscdk.services.pipes.sources.alpha.DynamoDBSource(
this.table,
this.parameters.build()
);
}
}
}