software.amazon.awscdk.services.kinesisfirehose.destinations.alpha.S3BucketProps Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kinesisfirehose-destinations-alpha Show documentation
Show all versions of kinesisfirehose-destinations-alpha Show documentation
CDK Destinations Constructs for AWS Kinesis Firehose
package software.amazon.awscdk.services.kinesisfirehose.destinations.alpha;
/**
* (experimental) Props for defining an S3 destination of a Kinesis Data Firehose delivery stream.
*
* Example:
*
*
* Bucket bucket;
* // Provide a Lambda function that will transform records before delivery, with custom
* // buffering and retry configuration
* Function lambdaFunction = Function.Builder.create(this, "Processor")
* .runtime(Runtime.NODEJS_LATEST)
* .handler("index.handler")
* .code(Code.fromAsset(join(__dirname, "process-records")))
* .build();
* LambdaFunctionProcessor lambdaProcessor = LambdaFunctionProcessor.Builder.create(lambdaFunction)
* .bufferInterval(Duration.minutes(5))
* .bufferSize(Size.mebibytes(5))
* .retries(5)
* .build();
* S3Bucket s3Destination = S3Bucket.Builder.create(bucket)
* .processor(lambdaProcessor)
* .build();
* DeliveryStream.Builder.create(this, "Delivery Stream")
* .destinations(List.of(s3Destination))
* .build();
*
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.102.0 (build e354887)", date = "2024-09-10T01:10:18.532Z")
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.kinesisfirehose.destinations.alpha.$Module.class, fqn = "@aws-cdk/aws-kinesisfirehose-destinations-alpha.S3BucketProps")
@software.amazon.jsii.Jsii.Proxy(S3BucketProps.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface S3BucketProps extends software.amazon.jsii.JsiiSerializable, software.amazon.awscdk.services.kinesisfirehose.destinations.alpha.CommonDestinationS3Props, software.amazon.awscdk.services.kinesisfirehose.destinations.alpha.CommonDestinationProps {
/**
* @return a {@link Builder} of {@link S3BucketProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link S3BucketProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
software.amazon.awscdk.Duration bufferingInterval;
software.amazon.awscdk.Size bufferingSize;
software.amazon.awscdk.services.kinesisfirehose.destinations.alpha.Compression compression;
java.lang.String dataOutputPrefix;
software.amazon.awscdk.services.kms.IKey encryptionKey;
java.lang.String errorOutputPrefix;
java.lang.Boolean logging;
software.amazon.awscdk.services.logs.ILogGroup logGroup;
software.amazon.awscdk.services.kinesisfirehose.alpha.IDataProcessor processor;
software.amazon.awscdk.services.iam.IRole role;
software.amazon.awscdk.services.kinesisfirehose.destinations.alpha.DestinationS3BackupProps s3Backup;
/**
* Sets the value of {@link S3BucketProps#getBufferingInterval}
* @param bufferingInterval The length of time that Firehose buffers incoming data before delivering it to the S3 bucket.
* Minimum: Duration.seconds(0)
* Maximum: Duration.seconds(900)
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder bufferingInterval(software.amazon.awscdk.Duration bufferingInterval) {
this.bufferingInterval = bufferingInterval;
return this;
}
/**
* Sets the value of {@link S3BucketProps#getBufferingSize}
* @param bufferingSize The size of the buffer that Kinesis Data Firehose uses for incoming data before delivering it to the S3 bucket.
* Minimum: Size.mebibytes(1)
* Maximum: Size.mebibytes(128)
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder bufferingSize(software.amazon.awscdk.Size bufferingSize) {
this.bufferingSize = bufferingSize;
return this;
}
/**
* Sets the value of {@link S3BucketProps#getCompression}
* @param compression The type of compression that Kinesis Data Firehose uses to compress the data that it delivers to the Amazon S3 bucket.
* The compression formats SNAPPY or ZIP cannot be specified for Amazon Redshift
* destinations because they are not supported by the Amazon Redshift COPY operation
* that reads from the S3 bucket.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder compression(software.amazon.awscdk.services.kinesisfirehose.destinations.alpha.Compression compression) {
this.compression = compression;
return this;
}
/**
* Sets the value of {@link S3BucketProps#getDataOutputPrefix}
* @param dataOutputPrefix A prefix that Kinesis Data Firehose evaluates and adds to records before writing them to S3.
* This prefix appears immediately following the bucket name.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder dataOutputPrefix(java.lang.String dataOutputPrefix) {
this.dataOutputPrefix = dataOutputPrefix;
return this;
}
/**
* Sets the value of {@link S3BucketProps#getEncryptionKey}
* @param encryptionKey The AWS KMS key used to encrypt the data that it delivers to your Amazon S3 bucket.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder encryptionKey(software.amazon.awscdk.services.kms.IKey encryptionKey) {
this.encryptionKey = encryptionKey;
return this;
}
/**
* Sets the value of {@link S3BucketProps#getErrorOutputPrefix}
* @param errorOutputPrefix A prefix that Kinesis Data Firehose evaluates and adds to failed records before writing them to S3.
* This prefix appears immediately following the bucket name.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder errorOutputPrefix(java.lang.String errorOutputPrefix) {
this.errorOutputPrefix = errorOutputPrefix;
return this;
}
/**
* Sets the value of {@link S3BucketProps#getLogging}
* @param logging If true, log errors when data transformation or data delivery fails.
* If logGroup
is provided, this will be implicitly set to true
.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder logging(java.lang.Boolean logging) {
this.logging = logging;
return this;
}
/**
* Sets the value of {@link S3BucketProps#getLogGroup}
* @param logGroup The CloudWatch log group where log streams will be created to hold error logs.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder logGroup(software.amazon.awscdk.services.logs.ILogGroup logGroup) {
this.logGroup = logGroup;
return this;
}
/**
* Sets the value of {@link S3BucketProps#getProcessor}
* @param processor The data transformation that should be performed on the data before writing to the destination.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder processor(software.amazon.awscdk.services.kinesisfirehose.alpha.IDataProcessor processor) {
this.processor = processor;
return this;
}
/**
* Sets the value of {@link S3BucketProps#getRole}
* @param role The IAM role associated with this destination.
* Assumed by Kinesis Data Firehose to invoke processors and write to destinations
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder role(software.amazon.awscdk.services.iam.IRole role) {
this.role = role;
return this;
}
/**
* Sets the value of {@link S3BucketProps#getS3Backup}
* @param s3Backup The configuration for backing up source records to S3.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder s3Backup(software.amazon.awscdk.services.kinesisfirehose.destinations.alpha.DestinationS3BackupProps s3Backup) {
this.s3Backup = s3Backup;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link S3BucketProps}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public S3BucketProps build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link S3BucketProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements S3BucketProps {
private final software.amazon.awscdk.Duration bufferingInterval;
private final software.amazon.awscdk.Size bufferingSize;
private final software.amazon.awscdk.services.kinesisfirehose.destinations.alpha.Compression compression;
private final java.lang.String dataOutputPrefix;
private final software.amazon.awscdk.services.kms.IKey encryptionKey;
private final java.lang.String errorOutputPrefix;
private final java.lang.Boolean logging;
private final software.amazon.awscdk.services.logs.ILogGroup logGroup;
private final software.amazon.awscdk.services.kinesisfirehose.alpha.IDataProcessor processor;
private final software.amazon.awscdk.services.iam.IRole role;
private final software.amazon.awscdk.services.kinesisfirehose.destinations.alpha.DestinationS3BackupProps s3Backup;
/**
* Constructor that initializes the object based on values retrieved from the JsiiObject.
* @param objRef Reference to the JSII managed object.
*/
protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
this.bufferingInterval = software.amazon.jsii.Kernel.get(this, "bufferingInterval", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.Duration.class));
this.bufferingSize = software.amazon.jsii.Kernel.get(this, "bufferingSize", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.Size.class));
this.compression = software.amazon.jsii.Kernel.get(this, "compression", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.kinesisfirehose.destinations.alpha.Compression.class));
this.dataOutputPrefix = software.amazon.jsii.Kernel.get(this, "dataOutputPrefix", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.encryptionKey = software.amazon.jsii.Kernel.get(this, "encryptionKey", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.kms.IKey.class));
this.errorOutputPrefix = software.amazon.jsii.Kernel.get(this, "errorOutputPrefix", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.logging = software.amazon.jsii.Kernel.get(this, "logging", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.logGroup = software.amazon.jsii.Kernel.get(this, "logGroup", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.logs.ILogGroup.class));
this.processor = software.amazon.jsii.Kernel.get(this, "processor", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.kinesisfirehose.alpha.IDataProcessor.class));
this.role = software.amazon.jsii.Kernel.get(this, "role", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.iam.IRole.class));
this.s3Backup = software.amazon.jsii.Kernel.get(this, "s3Backup", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.kinesisfirehose.destinations.alpha.DestinationS3BackupProps.class));
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
protected Jsii$Proxy(final Builder builder) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.bufferingInterval = builder.bufferingInterval;
this.bufferingSize = builder.bufferingSize;
this.compression = builder.compression;
this.dataOutputPrefix = builder.dataOutputPrefix;
this.encryptionKey = builder.encryptionKey;
this.errorOutputPrefix = builder.errorOutputPrefix;
this.logging = builder.logging;
this.logGroup = builder.logGroup;
this.processor = builder.processor;
this.role = builder.role;
this.s3Backup = builder.s3Backup;
}
@Override
public final software.amazon.awscdk.Duration getBufferingInterval() {
return this.bufferingInterval;
}
@Override
public final software.amazon.awscdk.Size getBufferingSize() {
return this.bufferingSize;
}
@Override
public final software.amazon.awscdk.services.kinesisfirehose.destinations.alpha.Compression getCompression() {
return this.compression;
}
@Override
public final java.lang.String getDataOutputPrefix() {
return this.dataOutputPrefix;
}
@Override
public final software.amazon.awscdk.services.kms.IKey getEncryptionKey() {
return this.encryptionKey;
}
@Override
public final java.lang.String getErrorOutputPrefix() {
return this.errorOutputPrefix;
}
@Override
public final java.lang.Boolean getLogging() {
return this.logging;
}
@Override
public final software.amazon.awscdk.services.logs.ILogGroup getLogGroup() {
return this.logGroup;
}
@Override
public final software.amazon.awscdk.services.kinesisfirehose.alpha.IDataProcessor getProcessor() {
return this.processor;
}
@Override
public final software.amazon.awscdk.services.iam.IRole getRole() {
return this.role;
}
@Override
public final software.amazon.awscdk.services.kinesisfirehose.destinations.alpha.DestinationS3BackupProps getS3Backup() {
return this.s3Backup;
}
@Override
@software.amazon.jsii.Internal
public com.fasterxml.jackson.databind.JsonNode $jsii$toJson() {
final com.fasterxml.jackson.databind.ObjectMapper om = software.amazon.jsii.JsiiObjectMapper.INSTANCE;
final com.fasterxml.jackson.databind.node.ObjectNode data = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
if (this.getBufferingInterval() != null) {
data.set("bufferingInterval", om.valueToTree(this.getBufferingInterval()));
}
if (this.getBufferingSize() != null) {
data.set("bufferingSize", om.valueToTree(this.getBufferingSize()));
}
if (this.getCompression() != null) {
data.set("compression", om.valueToTree(this.getCompression()));
}
if (this.getDataOutputPrefix() != null) {
data.set("dataOutputPrefix", om.valueToTree(this.getDataOutputPrefix()));
}
if (this.getEncryptionKey() != null) {
data.set("encryptionKey", om.valueToTree(this.getEncryptionKey()));
}
if (this.getErrorOutputPrefix() != null) {
data.set("errorOutputPrefix", om.valueToTree(this.getErrorOutputPrefix()));
}
if (this.getLogging() != null) {
data.set("logging", om.valueToTree(this.getLogging()));
}
if (this.getLogGroup() != null) {
data.set("logGroup", om.valueToTree(this.getLogGroup()));
}
if (this.getProcessor() != null) {
data.set("processor", om.valueToTree(this.getProcessor()));
}
if (this.getRole() != null) {
data.set("role", om.valueToTree(this.getRole()));
}
if (this.getS3Backup() != null) {
data.set("s3Backup", om.valueToTree(this.getS3Backup()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("@aws-cdk/aws-kinesisfirehose-destinations-alpha.S3BucketProps"));
struct.set("data", data);
final com.fasterxml.jackson.databind.node.ObjectNode obj = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
obj.set("$jsii.struct", struct);
return obj;
}
@Override
public final boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
S3BucketProps.Jsii$Proxy that = (S3BucketProps.Jsii$Proxy) o;
if (this.bufferingInterval != null ? !this.bufferingInterval.equals(that.bufferingInterval) : that.bufferingInterval != null) return false;
if (this.bufferingSize != null ? !this.bufferingSize.equals(that.bufferingSize) : that.bufferingSize != null) return false;
if (this.compression != null ? !this.compression.equals(that.compression) : that.compression != null) return false;
if (this.dataOutputPrefix != null ? !this.dataOutputPrefix.equals(that.dataOutputPrefix) : that.dataOutputPrefix != null) return false;
if (this.encryptionKey != null ? !this.encryptionKey.equals(that.encryptionKey) : that.encryptionKey != null) return false;
if (this.errorOutputPrefix != null ? !this.errorOutputPrefix.equals(that.errorOutputPrefix) : that.errorOutputPrefix != null) return false;
if (this.logging != null ? !this.logging.equals(that.logging) : that.logging != null) return false;
if (this.logGroup != null ? !this.logGroup.equals(that.logGroup) : that.logGroup != null) return false;
if (this.processor != null ? !this.processor.equals(that.processor) : that.processor != null) return false;
if (this.role != null ? !this.role.equals(that.role) : that.role != null) return false;
return this.s3Backup != null ? this.s3Backup.equals(that.s3Backup) : that.s3Backup == null;
}
@Override
public final int hashCode() {
int result = this.bufferingInterval != null ? this.bufferingInterval.hashCode() : 0;
result = 31 * result + (this.bufferingSize != null ? this.bufferingSize.hashCode() : 0);
result = 31 * result + (this.compression != null ? this.compression.hashCode() : 0);
result = 31 * result + (this.dataOutputPrefix != null ? this.dataOutputPrefix.hashCode() : 0);
result = 31 * result + (this.encryptionKey != null ? this.encryptionKey.hashCode() : 0);
result = 31 * result + (this.errorOutputPrefix != null ? this.errorOutputPrefix.hashCode() : 0);
result = 31 * result + (this.logging != null ? this.logging.hashCode() : 0);
result = 31 * result + (this.logGroup != null ? this.logGroup.hashCode() : 0);
result = 31 * result + (this.processor != null ? this.processor.hashCode() : 0);
result = 31 * result + (this.role != null ? this.role.hashCode() : 0);
result = 31 * result + (this.s3Backup != null ? this.s3Backup.hashCode() : 0);
return result;
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy