MDAA TS Docs
    Preparing search index...

    Creates the SQS queues declared in a module config, and binds them to Lambda functions as event sources with the permissions and validation the pairing requires.

    Index

    Constructors

    Properties

    CONSUME_ACTIONS: string[] = ...

    Queue actions the Lambda event source mapping requires of the consuming function's execution role in order to poll the queue.

    DEFAULT_FUNCTION_TIMEOUT_SECONDS: 3

    Timeout Lambda applies when the function does not configure one.

    DEFAULT_MAX_RECEIVE_COUNT: 5

    Deliveries before a message is redriven to the dead letter queue. AWS recommends at least 5, so Lambda retries a transient failure several times before the message is set aside.

    DEFAULT_VISIBILITY_TIMEOUT_SECONDS: 30

    Visibility timeout SQS applies when the queue does not configure one.

    DLQ_SUFFIX: "-dlq" = '-dlq'

    Suffix applied to the name of every generated dead letter queue.

    FIFO_SUFFIX: ".fifo" = '.fifo'

    Suffix SQS requires of FIFO queue names, appended by MdaaSqsQueue after name truncation.

    SEND_ACTIONS: string[] = ...

    Queue action a producing function's execution role requires in order to send to the queue.

    Methods

    • Builds an empty allow statement for a queue resource policy. Principals are added by the caller, which shares one statement per queue and grant type across every function granted it.

      resources: ['*'] denotes the queue the policy is attached to, matching the queue's own EnforceSSL statement and the dead letter queue grant in EventBridgeHelper.createDlq.

      Parameters

      • sid: string
      • actions: string[]

      Returns PolicyStatement

    • Throws when a queue name is not usable as an SQS queue name, carries the '.fifo' suffix, or contradicts itself on FIFO.

      SQS permits only alphanumeric characters, hyphens and underscores, rejecting anything else with InvalidParameterValue when the queue is created. MDAA's own resource-name validation is more permissive -- it allows '.' so that the FIFO suffix survives -- so a name containing a '.' would otherwise synthesize cleanly and fail on deploy.

      Parameters

      Returns void

    • Throws when the queue a function is bound to has a visibility timeout shorter than the function's own timeout. Does nothing when the queue key does not resolve — that is reported, with the available keys for context, when the event source is bound.

      Lambda rejects this pairing when the event source mapping is created or updated, but CDK does not validate it, so without this guard a misconfigured pipeline passes synthesis and fails only on deploy. Lambda also enforces the constraint only at mapping create/update — raising a function timeout afterwards leaves the existing mapping enabled in an invalid state, where messages can become visible again mid-processing and be delivered twice. This guard therefore has to run on every synthesis, not only when a queue or mapping is newly introduced.

      Parameters

      • queues: NamedSqsQueueProps
      • queueName: string
      • functionName: string
      • OptionalfunctionTimeoutSeconds: number

      Returns void