io.cloudshiftdev.awscdk.services.lambda.eventsources.SqsEventSource.kt Maven / Gradle / Ivy
The newest version!
@file:Suppress("RedundantVisibilityModifier","RedundantUnitReturnType","RemoveRedundantQualifierName","unused","UnusedImport","ClassName","REDUNDANT_PROJECTION","DEPRECATION")
package io.cloudshiftdev.awscdk.services.lambda.eventsources
import io.cloudshiftdev.awscdk.Duration
import io.cloudshiftdev.awscdk.common.CdkDslMarker
import io.cloudshiftdev.awscdk.common.CdkObject
import io.cloudshiftdev.awscdk.services.kms.IKey
import io.cloudshiftdev.awscdk.services.lambda.IEventSource
import io.cloudshiftdev.awscdk.services.lambda.IFunction
import kotlin.Any
import kotlin.Boolean
import kotlin.Number
import kotlin.String
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import io.cloudshiftdev.awscdk.services.sqs.IQueue as CloudshiftdevAwscdkServicesSqsIQueue
import software.amazon.awscdk.services.sqs.IQueue as AmazonAwscdkServicesSqsIQueue
/**
* Use an Amazon SQS queue as an event source for AWS Lambda.
*
* Example:
*
* ```
* import io.cloudshiftdev.awscdk.services.lambda.eventsources.*;
* import io.cloudshiftdev.awscdk.services.sqs.*;
* Function fn;
* Queue queue = new Queue(this, "Queue");
* fn.addEventSource(new SqsEventSource(queue));
* ```
*/
public open class SqsEventSource(
cdkObject: software.amazon.awscdk.services.lambda.eventsources.SqsEventSource,
) : CdkObject(cdkObject),
IEventSource {
public constructor(queue: CloudshiftdevAwscdkServicesSqsIQueue) :
this(software.amazon.awscdk.services.lambda.eventsources.SqsEventSource(queue.let(CloudshiftdevAwscdkServicesSqsIQueue.Companion::unwrap))
)
public constructor(queue: CloudshiftdevAwscdkServicesSqsIQueue, props: SqsEventSourceProps) :
this(software.amazon.awscdk.services.lambda.eventsources.SqsEventSource(queue.let(CloudshiftdevAwscdkServicesSqsIQueue.Companion::unwrap),
props.let(SqsEventSourceProps.Companion::unwrap))
)
public constructor(queue: CloudshiftdevAwscdkServicesSqsIQueue,
props: SqsEventSourceProps.Builder.() -> Unit) : this(queue, SqsEventSourceProps(props)
)
/**
* Called by `lambda.addEventSource` to allow the event source to bind to this function.
*
* @param target
*/
public override fun bind(target: IFunction) {
unwrap(this).bind(target.let(IFunction.Companion::unwrap))
}
/**
* The ARN for this EventSourceMapping.
*/
public open fun eventSourceMappingArn(): String = unwrap(this).getEventSourceMappingArn()
/**
* The identifier for this EventSourceMapping.
*/
public open fun eventSourceMappingId(): String = unwrap(this).getEventSourceMappingId()
/**
*
*/
public open fun queue(): CloudshiftdevAwscdkServicesSqsIQueue =
unwrap(this).getQueue().let(CloudshiftdevAwscdkServicesSqsIQueue::wrap)
/**
* A fluent builder for [io.cloudshiftdev.awscdk.services.lambda.eventsources.SqsEventSource].
*/
@CdkDslMarker
public interface Builder {
/**
* The largest number of records that AWS Lambda will retrieve from your event source at the
* time of invoking your function.
*
* Your function receives an
* event with all the retrieved records.
*
* Valid Range: Minimum value of 1. Maximum value of 10.
* If `maxBatchingWindow` is configured, this value can go up to 10,000.
*
* Default: 10
*
* @param batchSize The largest number of records that AWS Lambda will retrieve from your event
* source at the time of invoking your function.
*/
public fun batchSize(batchSize: Number)
/**
* If the SQS event source mapping should be enabled.
*
* Default: true
*
* @param enabled If the SQS event source mapping should be enabled.
*/
public fun enabled(enabled: Boolean)
/**
* Add Customer managed KMS key to encrypt Filter Criteria.
*
* Default: - none
*
* [Documentation](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk)
* @param filterEncryption Add Customer managed KMS key to encrypt Filter Criteria.
*/
public fun filterEncryption(filterEncryption: IKey)
/**
* Add filter criteria option.
*
* Default: - None
*
* @param filters Add filter criteria option.
*/
public fun filters(filters: List