aws_ddk_core.stages.SqsToLambdaStage

class aws_ddk_core.stages.SqsToLambdaStage(*args: Any, **kwargs)

Class that represents an SQS to Lambda Transform DDK Stage.

__init__(scope: constructs.Construct, id: str, environment_id: str, code: aws_cdk.aws_lambda.Code, handler: str, runtime: aws_cdk.aws_lambda.Runtime = <aws_cdk.aws_lambda.Runtime object>, role: typing.Optional[aws_cdk.aws_iam.IRole] = None, memory_size: typing.Optional[int] = None, timeout: typing.Optional[aws_cdk.Duration] = None, visibility_timeout: typing.Optional[aws_cdk.Duration] = None, dead_letter_queue_enabled: bool = False, max_receive_count: int = 1, batch_size: typing.Optional[int] = None) None

DDK SQS to Lambda stage.

It implements an Amazon SQS queue connected to an AWS Lambda function, with an optional DLQ.

Parameters
  • scope (Construct) – Scope within which this construct is defined

  • id (str) – Identifier of the stage

  • environment_id (str) – Identifier of the environment

  • code (Code) – The source code of the Lambda function

  • handler (str) – The name of the method within the code that Lambda calls to execute the function

  • runtime (Runtime) – The runtime environment for the Lambda function. PYTHON_3_9 by default

  • role (Optional[IRole]) – Lambda execution role

  • memory_size (Optional[int]) – The amount of memory, in MB, that is allocated to the Lambda function. 256 by default

  • timeout (Optional[Duration]) – The function execution time (in seconds) after which Lambda terminates the function. aws_cdk.Duration.seconds(120) by default

  • visibility_timeout (Optional[Duration]) – Timeout of processing a single message in the queue. Default: Duration.seconds(120).

  • dead_letter_queue_enabled (Optional[bool]) – Determines if DLQ is enabled. False by default

  • max_receive_count (int) – he number of times a message can be unsuccessfully dequeued before being moved to the dead-letter queue. 1 by default

  • batch_size (Optional[int]) – The maximum number of records retrieved from the event source at the function invocation time. 10 by default

Methods

__init__(scope, id, environment_id, code, ...)

DDK SQS to Lambda stage.

get_event_pattern()

Get output event pattern of the stage.

get_targets()

Get input targets of the stage.

is_construct(x)

(deprecated) Checks if x is a construct.

to_string()

Returns a string representation of this construct.

Attributes

dlq

DeadLetterQueue The SQS dead letter queue

function

Function The Lambda function

node

The tree node.

queue

Queue The SQS queue

property dlq: Optional[aws_cdk.aws_sqs.DeadLetterQueue]

DeadLetterQueue The SQS dead letter queue

Type

Return

property function: aws_cdk.aws_lambda.IFunction

Function The Lambda function

Type

Return

get_event_pattern() Optional[aws_cdk.aws_events.EventPattern]

Get output event pattern of the stage.

Event pattern describes the structure of output event(s) produced by this stage. Event Rules use event patterns to select events and route them to targets.

Returns

event_pattern – Event pattern

Return type

Optional[EventPattern]

get_targets() Optional[List[aws_cdk.aws_events.IRuleTarget]]

Get input targets of the stage.

Targets are used by Event Rules to describe what should be invoked when a rule matches an event.

Returns

targets – List of targets

Return type

Optional[List[IRuleTarget]]

property queue: aws_cdk.aws_sqs.IQueue

Queue The SQS queue

Type

Return