io.github.cdklabs.cdk.amazonmq.RabbitMqEventSource Maven / Gradle / Ivy
package io.github.cdklabs.cdk.amazonmq;
/**
* (experimental) Represents an AWS Lambda Event Source Mapping for RabbitMQ.
*
* This event source will add additional permissions to
* the AWS Lambda function's IAM Role following https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html#events-mq-permissions
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.102.0 (build e354887)", date = "2024-08-08T22:30:31.812Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Jsii(module = io.github.cdklabs.cdk.amazonmq.$Module.class, fqn = "@cdklabs/cdk-amazonmq.RabbitMqEventSource")
public class RabbitMqEventSource extends io.github.cdklabs.cdk.amazonmq.EventSourceBase implements software.amazon.awscdk.services.lambda.IEventSource {
protected RabbitMqEventSource(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected RabbitMqEventSource(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* (experimental) Instantiates an AWS Lambda Event Source Mapping for RabbitMQ.
*
* This event source will add additional permissions to
* the AWS Lambda function's IAM Role following https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html#events-mq-permissions
*
* @param props properties of the RabbitMQ event source. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public RabbitMqEventSource(final @org.jetbrains.annotations.NotNull io.github.cdklabs.cdk.amazonmq.RabbitMqEventSourceProps props) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(props, "props is required") });
}
/**
* (experimental) A fluent builder for {@link io.github.cdklabs.cdk.amazonmq.RabbitMqEventSource}.
*/
@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}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static Builder create() {
return new Builder();
}
private final io.github.cdklabs.cdk.amazonmq.RabbitMqEventSourceProps.Builder props;
private Builder() {
this.props = new io.github.cdklabs.cdk.amazonmq.RabbitMqEventSourceProps.Builder();
}
/**
* (experimental) A secret with credentials of the user to use when receiving messages.
*
* The credentials in the secret have fields required:
*
*
* - username
* - password
*
*
* @return {@code this}
* @param credentials A secret with credentials of the user to use when receiving messages. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder credentials(final software.amazon.awscdk.services.secretsmanager.ISecret credentials) {
this.props.credentials(credentials);
return this;
}
/**
* (experimental) The name of the queue that the function will receive messages from.
*
* @return {@code this}
* @param queueName The name of the queue that the function will receive messages from. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder queueName(final java.lang.String queueName) {
this.props.queueName(queueName);
return this;
}
/**
* (experimental) If the default permissions should be added to the Lambda function's execution role.
*
* Default: true
*
* @return {@code this}
* @param addPermissions If the default permissions should be added to the Lambda function's execution role. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder addPermissions(final java.lang.Boolean addPermissions) {
this.props.addPermissions(addPermissions);
return this;
}
/**
* (experimental) source at the time of invoking your function.
*
* Your function receives an
* The largest number of records that AWS Lambda will retrieve from your event
* event with all the retrieved records.
*
* Valid Range:
*
*
* - Minimum value of 1
* - Maximum value of: 10000
*
*
* Default: 100
*
* @return {@code this}
* @param batchSize source at the time of invoking your function. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder batchSize(final java.lang.Number batchSize) {
this.props.batchSize(batchSize);
return this;
}
/**
* (experimental) If the stream event source mapping should be enabled.
*
* Default: true
*
* @return {@code this}
* @param enabled If the stream event source mapping should be enabled. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder enabled(final java.lang.Boolean enabled) {
this.props.enabled(enabled);
return this;
}
/**
* (experimental) The maximum amount of time to gather records before invoking the function.
*
* Maximum of Duration.minutes(5).
*
* Default: - Duration.millis(500) for Amazon MQ.
*
* @return {@code this}
* @see https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html#invocation-eventsourcemapping-batching
* @param maxBatchingWindow The maximum amount of time to gather records before invoking the function. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder maxBatchingWindow(final software.amazon.awscdk.Duration maxBatchingWindow) {
this.props.maxBatchingWindow(maxBatchingWindow);
return this;
}
/**
* (experimental) The RabbitMQ broker deployment to receive messages from.
*
* @return {@code this}
* @param broker The RabbitMQ broker deployment to receive messages from. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder broker(final io.github.cdklabs.cdk.amazonmq.IRabbitMqBrokerDeployment broker) {
this.props.broker(broker);
return this;
}
/**
* (experimental) he name of the RabbitMQ virtual host from which a queue will be the source of messages.
*
* Default: - the default virtual host '/' will be used.
*
* @return {@code this}
* @param virtualHost he name of the RabbitMQ virtual host from which a queue will be the source of messages. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder virtualHost(final java.lang.String virtualHost) {
this.props.virtualHost(virtualHost);
return this;
}
/**
* @return a newly built instance of {@link io.github.cdklabs.cdk.amazonmq.RabbitMqEventSource}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public io.github.cdklabs.cdk.amazonmq.RabbitMqEventSource build() {
return new io.github.cdklabs.cdk.amazonmq.RabbitMqEventSource(
this.props.build()
);
}
}
}