![JAR search and dependency download from the Maven repository](/logo.png)
io.cloudshiftdev.awscdk.services.stepfunctions.tasks.SqsSendMessage.kt Maven / Gradle / Ivy
@file:Suppress("RedundantVisibilityModifier","RedundantUnitReturnType","RemoveRedundantQualifierName","unused","UnusedImport","ClassName","REDUNDANT_PROJECTION","DEPRECATION")
package io.cloudshiftdev.awscdk.services.stepfunctions.tasks
import io.cloudshiftdev.awscdk.Duration
import io.cloudshiftdev.awscdk.common.CdkDslMarker
import io.cloudshiftdev.awscdk.common.CdkObjectWrappers
import io.cloudshiftdev.awscdk.services.sqs.IQueue
import io.cloudshiftdev.awscdk.services.stepfunctions.Credentials
import io.cloudshiftdev.awscdk.services.stepfunctions.IntegrationPattern
import io.cloudshiftdev.awscdk.services.stepfunctions.TaskInput
import io.cloudshiftdev.awscdk.services.stepfunctions.TaskStateBase
import io.cloudshiftdev.awscdk.services.stepfunctions.Timeout
import kotlin.Any
import kotlin.Deprecated
import kotlin.String
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName
import io.cloudshiftdev.constructs.Construct as CloudshiftdevConstructsConstruct
import software.constructs.Construct as SoftwareConstructsConstruct
/**
* A StepFunctions Task to send messages to SQS queue.
*
* Example:
*
* ```
* Queue queue = new Queue(this, "Queue");
* // Use a field from the execution data as message.
* SqsSendMessage task1 = SqsSendMessage.Builder.create(this, "Send1")
* .queue(queue)
* .messageBody(TaskInput.fromJsonPathAt("$.message"))
* .build();
* // Combine a field from the execution data with
* // a literal object.
* SqsSendMessage task2 = SqsSendMessage.Builder.create(this, "Send2")
* .queue(queue)
* .messageBody(TaskInput.fromObject(Map.of(
* "field1", "somedata",
* "field2", JsonPath.stringAt("$.field2"))))
* .build();
* ```
*/
public open class SqsSendMessage(
cdkObject: software.amazon.awscdk.services.stepfunctions.tasks.SqsSendMessage,
) : TaskStateBase(cdkObject) {
public constructor(
scope: CloudshiftdevConstructsConstruct,
id: String,
props: SqsSendMessageProps,
) :
this(software.amazon.awscdk.services.stepfunctions.tasks.SqsSendMessage(scope.let(CloudshiftdevConstructsConstruct.Companion::unwrap),
id, props.let(SqsSendMessageProps.Companion::unwrap))
)
public constructor(
scope: CloudshiftdevConstructsConstruct,
id: String,
props: SqsSendMessageProps.Builder.() -> Unit,
) : this(scope, id, SqsSendMessageProps(props)
)
/**
* A fluent builder for [io.cloudshiftdev.awscdk.services.stepfunctions.tasks.SqsSendMessage].
*/
@CdkDslMarker
public interface Builder {
/**
* An optional description for this state.
*
* Default: - No comment
*
* @param comment An optional description for this state.
*/
public fun comment(comment: String)
/**
* Credentials for an IAM Role that the State Machine assumes for executing the task.
*
* This enables cross-account resource invocations.
*
* Default: - None (Task is executed using the State Machine's execution role)
*
* [Documentation](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-access-cross-acct-resources.html)
* @param credentials Credentials for an IAM Role that the State Machine assumes for executing
* the task.
*/
public fun credentials(credentials: Credentials)
/**
* Credentials for an IAM Role that the State Machine assumes for executing the task.
*
* This enables cross-account resource invocations.
*
* Default: - None (Task is executed using the State Machine's execution role)
*
* [Documentation](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-access-cross-acct-resources.html)
* @param credentials Credentials for an IAM Role that the State Machine assumes for executing
* the task.
*/
@kotlin.Suppress("INAPPLICABLE_JVM_NAME")
@JvmName("6d701c6cd97dd6102f4693ee5141d08447775453d5d2530d09a8b3f13da328d9")
public fun credentials(credentials: Credentials.Builder.() -> Unit)
/**
* The length of time, for which to delay a message.
*
* Messages that you send to the queue remain invisible to consumers for the duration
* of the delay period. The maximum allowed delay is 15 minutes.
*
* Default: - delay set on the queue. If a delay is not set on the queue,
* messages are sent immediately (0 seconds).
*
* @param delay The length of time, for which to delay a message.
*/
public fun delay(delay: Duration)
/**
* (deprecated) Timeout for the heartbeat.
*
* Default: - None
*
* @deprecated use `heartbeatTimeout`
* @param heartbeat Timeout for the heartbeat.
*/
@Deprecated(message = "deprecated in CDK")
public fun heartbeat(heartbeat: Duration)
/**
* Timeout for the heartbeat.
*
* [disable-awslint:duration-prop-type] is needed because all props interface in
* aws-stepfunctions-tasks extend this interface
*
* Default: - None
*
* @param heartbeatTimeout Timeout for the heartbeat.
*/
public fun heartbeatTimeout(heartbeatTimeout: Timeout)
/**
* JSONPath expression to select part of the state to be the input to this state.
*
* May also be the special value JsonPath.DISCARD, which will cause the effective
* input to be the empty object {}.
*
* Default: - The entire task input (JSON path '$')
*
* @param inputPath JSONPath expression to select part of the state to be the input to this
* state.
*/
public fun inputPath(inputPath: String)
/**
* AWS Step Functions integrates with services directly in the Amazon States Language.
*
* You can control these AWS services using service integration patterns.
*
* Depending on the AWS Service, the Service Integration Pattern availability will vary.
*
* Default: - `IntegrationPattern.REQUEST_RESPONSE` for most tasks.
* `IntegrationPattern.RUN_JOB` for the following exceptions:
* `BatchSubmitJob`, `EmrAddStep`, `EmrCreateCluster`, `EmrTerminationCluster`, and
* `EmrContainersStartJobRun`.
*
* [Documentation](https://docs.aws.amazon.com/step-functions/latest/dg/connect-supported-services.html)
* @param integrationPattern AWS Step Functions integrates with services directly in the Amazon
* States Language.
*/
public fun integrationPattern(integrationPattern: IntegrationPattern)
/**
* The text message to send to the queue.
*
* @param messageBody The text message to send to the queue.
*/
public fun messageBody(messageBody: TaskInput)
/**
* The token used for deduplication of sent messages.
*
* Any messages sent with the same deduplication ID are accepted successfully,
* but aren't delivered during the 5-minute deduplication interval.
*
* Default: - None
*
* @param messageDeduplicationId The token used for deduplication of sent messages.
*/
public fun messageDeduplicationId(messageDeduplicationId: String)
/**
* The tag that specifies that a message belongs to a specific message group.
*
* Messages that belong to the same message group are processed in a FIFO manner.
* Messages in different message groups might be processed out of order.
*
* Default: - None
*
* @param messageGroupId The tag that specifies that a message belongs to a specific message
* group.
*/
public fun messageGroupId(messageGroupId: String)
/**
* JSONPath expression to select select a portion of the state output to pass to the next state.
*
* May also be the special value JsonPath.DISCARD, which will cause the effective
* output to be the empty object {}.
*
* Default: - The entire JSON node determined by the state input, the task result,
* and resultPath is passed to the next state (JSON path '$')
*
* @param outputPath JSONPath expression to select select a portion of the state output to pass
* to the next state.
*/
public fun outputPath(outputPath: String)
/**
* The SQS queue that messages will be sent to.
*
* @param queue The SQS queue that messages will be sent to.
*/
public fun queue(queue: IQueue)
/**
* JSONPath expression to indicate where to inject the state's output.
*
* May also be the special value JsonPath.DISCARD, which will cause the state's
* input to become its output.
*
* Default: - Replaces the entire input with the result (JSON path '$')
*
* @param resultPath JSONPath expression to indicate where to inject the state's output.
*/
public fun resultPath(resultPath: String)
/**
* The JSON that will replace the state's raw result and become the effective result before
* ResultPath is applied.
*
* You can use ResultSelector to create a payload with values that are static
* or selected from the state's raw result.
*
* Default: - None
*
* [Documentation](https://docs.aws.amazon.com/step-functions/latest/dg/input-output-inputpath-params.html#input-output-resultselector)
* @param resultSelector The JSON that will replace the state's raw result and become the
* effective result before ResultPath is applied.
*/
public fun resultSelector(resultSelector: Map)
/**
* Optional name for this state.
*
* Default: - The construct ID will be used as state name
*
* @param stateName Optional name for this state.
*/
public fun stateName(stateName: String)
/**
* Timeout for the task.
*
* [disable-awslint:duration-prop-type] is needed because all props interface in
* aws-stepfunctions-tasks extend this interface
*
* Default: - None
*
* @param taskTimeout Timeout for the task.
*/
public fun taskTimeout(taskTimeout: Timeout)
/**
* (deprecated) Timeout for the task.
*
* Default: - None
*
* @deprecated use `taskTimeout`
* @param timeout Timeout for the task.
*/
@Deprecated(message = "deprecated in CDK")
public fun timeout(timeout: Duration)
}
private class BuilderImpl(
scope: SoftwareConstructsConstruct,
id: String,
) : Builder {
private val cdkBuilder:
software.amazon.awscdk.services.stepfunctions.tasks.SqsSendMessage.Builder =
software.amazon.awscdk.services.stepfunctions.tasks.SqsSendMessage.Builder.create(scope, id)
/**
* An optional description for this state.
*
* Default: - No comment
*
* @param comment An optional description for this state.
*/
override fun comment(comment: String) {
cdkBuilder.comment(comment)
}
/**
* Credentials for an IAM Role that the State Machine assumes for executing the task.
*
* This enables cross-account resource invocations.
*
* Default: - None (Task is executed using the State Machine's execution role)
*
* [Documentation](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-access-cross-acct-resources.html)
* @param credentials Credentials for an IAM Role that the State Machine assumes for executing
* the task.
*/
override fun credentials(credentials: Credentials) {
cdkBuilder.credentials(credentials.let(Credentials.Companion::unwrap))
}
/**
* Credentials for an IAM Role that the State Machine assumes for executing the task.
*
* This enables cross-account resource invocations.
*
* Default: - None (Task is executed using the State Machine's execution role)
*
* [Documentation](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-access-cross-acct-resources.html)
* @param credentials Credentials for an IAM Role that the State Machine assumes for executing
* the task.
*/
@kotlin.Suppress("INAPPLICABLE_JVM_NAME")
@JvmName("6d701c6cd97dd6102f4693ee5141d08447775453d5d2530d09a8b3f13da328d9")
override fun credentials(credentials: Credentials.Builder.() -> Unit): Unit =
credentials(Credentials(credentials))
/**
* The length of time, for which to delay a message.
*
* Messages that you send to the queue remain invisible to consumers for the duration
* of the delay period. The maximum allowed delay is 15 minutes.
*
* Default: - delay set on the queue. If a delay is not set on the queue,
* messages are sent immediately (0 seconds).
*
* @param delay The length of time, for which to delay a message.
*/
override fun delay(delay: Duration) {
cdkBuilder.delay(delay.let(Duration.Companion::unwrap))
}
/**
* (deprecated) Timeout for the heartbeat.
*
* Default: - None
*
* @deprecated use `heartbeatTimeout`
* @param heartbeat Timeout for the heartbeat.
*/
@Deprecated(message = "deprecated in CDK")
override fun heartbeat(heartbeat: Duration) {
cdkBuilder.heartbeat(heartbeat.let(Duration.Companion::unwrap))
}
/**
* Timeout for the heartbeat.
*
* [disable-awslint:duration-prop-type] is needed because all props interface in
* aws-stepfunctions-tasks extend this interface
*
* Default: - None
*
* @param heartbeatTimeout Timeout for the heartbeat.
*/
override fun heartbeatTimeout(heartbeatTimeout: Timeout) {
cdkBuilder.heartbeatTimeout(heartbeatTimeout.let(Timeout.Companion::unwrap))
}
/**
* JSONPath expression to select part of the state to be the input to this state.
*
* May also be the special value JsonPath.DISCARD, which will cause the effective
* input to be the empty object {}.
*
* Default: - The entire task input (JSON path '$')
*
* @param inputPath JSONPath expression to select part of the state to be the input to this
* state.
*/
override fun inputPath(inputPath: String) {
cdkBuilder.inputPath(inputPath)
}
/**
* AWS Step Functions integrates with services directly in the Amazon States Language.
*
* You can control these AWS services using service integration patterns.
*
* Depending on the AWS Service, the Service Integration Pattern availability will vary.
*
* Default: - `IntegrationPattern.REQUEST_RESPONSE` for most tasks.
* `IntegrationPattern.RUN_JOB` for the following exceptions:
* `BatchSubmitJob`, `EmrAddStep`, `EmrCreateCluster`, `EmrTerminationCluster`, and
* `EmrContainersStartJobRun`.
*
* [Documentation](https://docs.aws.amazon.com/step-functions/latest/dg/connect-supported-services.html)
* @param integrationPattern AWS Step Functions integrates with services directly in the Amazon
* States Language.
*/
override fun integrationPattern(integrationPattern: IntegrationPattern) {
cdkBuilder.integrationPattern(integrationPattern.let(IntegrationPattern.Companion::unwrap))
}
/**
* The text message to send to the queue.
*
* @param messageBody The text message to send to the queue.
*/
override fun messageBody(messageBody: TaskInput) {
cdkBuilder.messageBody(messageBody.let(TaskInput.Companion::unwrap))
}
/**
* The token used for deduplication of sent messages.
*
* Any messages sent with the same deduplication ID are accepted successfully,
* but aren't delivered during the 5-minute deduplication interval.
*
* Default: - None
*
* @param messageDeduplicationId The token used for deduplication of sent messages.
*/
override fun messageDeduplicationId(messageDeduplicationId: String) {
cdkBuilder.messageDeduplicationId(messageDeduplicationId)
}
/**
* The tag that specifies that a message belongs to a specific message group.
*
* Messages that belong to the same message group are processed in a FIFO manner.
* Messages in different message groups might be processed out of order.
*
* Default: - None
*
* @param messageGroupId The tag that specifies that a message belongs to a specific message
* group.
*/
override fun messageGroupId(messageGroupId: String) {
cdkBuilder.messageGroupId(messageGroupId)
}
/**
* JSONPath expression to select select a portion of the state output to pass to the next state.
*
* May also be the special value JsonPath.DISCARD, which will cause the effective
* output to be the empty object {}.
*
* Default: - The entire JSON node determined by the state input, the task result,
* and resultPath is passed to the next state (JSON path '$')
*
* @param outputPath JSONPath expression to select select a portion of the state output to pass
* to the next state.
*/
override fun outputPath(outputPath: String) {
cdkBuilder.outputPath(outputPath)
}
/**
* The SQS queue that messages will be sent to.
*
* @param queue The SQS queue that messages will be sent to.
*/
override fun queue(queue: IQueue) {
cdkBuilder.queue(queue.let(IQueue.Companion::unwrap))
}
/**
* JSONPath expression to indicate where to inject the state's output.
*
* May also be the special value JsonPath.DISCARD, which will cause the state's
* input to become its output.
*
* Default: - Replaces the entire input with the result (JSON path '$')
*
* @param resultPath JSONPath expression to indicate where to inject the state's output.
*/
override fun resultPath(resultPath: String) {
cdkBuilder.resultPath(resultPath)
}
/**
* The JSON that will replace the state's raw result and become the effective result before
* ResultPath is applied.
*
* You can use ResultSelector to create a payload with values that are static
* or selected from the state's raw result.
*
* Default: - None
*
* [Documentation](https://docs.aws.amazon.com/step-functions/latest/dg/input-output-inputpath-params.html#input-output-resultselector)
* @param resultSelector The JSON that will replace the state's raw result and become the
* effective result before ResultPath is applied.
*/
override fun resultSelector(resultSelector: Map) {
cdkBuilder.resultSelector(resultSelector.mapValues{CdkObjectWrappers.unwrap(it.value)})
}
/**
* Optional name for this state.
*
* Default: - The construct ID will be used as state name
*
* @param stateName Optional name for this state.
*/
override fun stateName(stateName: String) {
cdkBuilder.stateName(stateName)
}
/**
* Timeout for the task.
*
* [disable-awslint:duration-prop-type] is needed because all props interface in
* aws-stepfunctions-tasks extend this interface
*
* Default: - None
*
* @param taskTimeout Timeout for the task.
*/
override fun taskTimeout(taskTimeout: Timeout) {
cdkBuilder.taskTimeout(taskTimeout.let(Timeout.Companion::unwrap))
}
/**
* (deprecated) Timeout for the task.
*
* Default: - None
*
* @deprecated use `taskTimeout`
* @param timeout Timeout for the task.
*/
@Deprecated(message = "deprecated in CDK")
override fun timeout(timeout: Duration) {
cdkBuilder.timeout(timeout.let(Duration.Companion::unwrap))
}
public fun build(): software.amazon.awscdk.services.stepfunctions.tasks.SqsSendMessage =
cdkBuilder.build()
}
public companion object {
public operator fun invoke(
scope: CloudshiftdevConstructsConstruct,
id: String,
block: Builder.() -> Unit = {},
): SqsSendMessage {
val builderImpl = BuilderImpl(CloudshiftdevConstructsConstruct.unwrap(scope), id)
return SqsSendMessage(builderImpl.apply(block).build())
}
internal
fun wrap(cdkObject: software.amazon.awscdk.services.stepfunctions.tasks.SqsSendMessage):
SqsSendMessage = SqsSendMessage(cdkObject)
internal fun unwrap(wrapped: SqsSendMessage):
software.amazon.awscdk.services.stepfunctions.tasks.SqsSendMessage = wrapped.cdkObject as
software.amazon.awscdk.services.stepfunctions.tasks.SqsSendMessage
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy