Header menu logo FsCDK

SNS SQS Amazon SNS and SQS

Amazon SNS (Simple Notification Service) and SQS (Simple Queue Service) are fully managed messaging services that enable you to decouple and scale microservices, distributed systems, and serverless applications.

SNS/SQS Messaging Patterns

SNS/SQS Messaging Patterns

Quick Start

#r "../src/bin/Release/net8.0/publish/Amazon.JSII.Runtime.dll"
#r "../src/bin/Release/net8.0/publish/Constructs.dll"
#r "../src/bin/Release/net8.0/publish/Amazon.CDK.Lib.dll"
#r "../src/bin/Release/net8.0/publish/FsCDK.dll"

open FsCDK
open Amazon.CDK
open Amazon.CDK.AWS.SNS
open Amazon.CDK.AWS.SNS.Subscriptions
open Amazon.CDK.AWS.SQS
open Amazon.CDK.AWS.Lambda

SNS: Basic Topic

Create a simple SNS topic for pub/sub messaging.

stack "BasicSNS" { topic "OrderNotifications" { displayName "Order Processing Notifications" } }

SNS: FIFO Topic

Create a FIFO topic for ordered, exactly-once message delivery.

stack "FIFOTopic" {
    topic "Transactions.fifo" {
        displayName "Transaction Events"
        fifo true
        contentBasedDeduplication true
    }
}

SNS: Topic with All Options

Configure a topic with all available options.

stack "FullTopic" {
    topic "SecureNotifications" {
        constructId "MySecureTopic"
        displayName "Secure Notification Topic"
        enforceSSL true
        signatureVersion "2"
        tracingConfig TracingConfig.ACTIVE
        messageRetentionPeriodInDays 7.0
    }
}

SQS: Basic Queue

Create a simple SQS queue for asynchronous message processing.

stack "BasicSQS" {
    queue "OrderProcessing" {
        visibilityTimeout 30.0
        retentionPeriod 345600.0 // 4 days
    }
}

SQS: FIFO Queue

Create a FIFO queue for ordered message processing.

stack "FIFOQueue" {
    queue "Transactions.fifo" {
        fifo true
        contentBasedDeduplication true
        visibilityTimeout 60.0
    }
}

SQS: Queue with Dead Letter Queue

Implement error handling with a dead-letter queue using let! to bind the DLQ.

stack "QueueWithDLQ" {
    // Create a dead-letter queue first and bind it with let!
    let! dlqQueue =
        queue "ProcessingDLQ" {
            retentionPeriod 1209600.0 // 14 days
        }

    // Create the DLQ configuration
    let dlqConfig =
        deadLetterQueue {
            queue dlqQueue
            maxReceiveCount 3
        }

    // Create main queue with DLQ
    queue "OrderProcessing" {
        visibilityTimeout 30.0
        deadLetterQueue dlqConfig
    }
}

SNS Subscription Builders

FsCDK provides type-safe subscription builders for all SNS subscription types. Each builder creates an ITopicSubscription that can be added to topics.

Available Subscription Builders

Builder

Purpose

Required Field

lambdaSubscription

Subscribe Lambda functions

handler

sqsSubscription

Subscribe SQS queues

queue

emailSubscription

Subscribe email addresses

email

smsSubscription

Subscribe phone numbers

phoneNumber

urlSubscription

Subscribe HTTP/HTTPS endpoints

url

Common Options

All subscription builders support these optional configurations:

Lambda Subscription

Subscribe a Lambda function to an SNS topic. The function is invoked for each message published. Use let! within a stack CE to convert FsCDK builders to CDK constructs.

stack "LambdaSubscriptionStack" {
    // Create Lambda function using FsCDK builder
    let! processorFunc =
        lambda "Processor" {
            handler "App::ProcessEvent"
            runtime Runtime.DOTNET_8
            code (Code.FromAsset("./lambda"))
        }

    // Create topic with Lambda subscription using implicit yield
    topic "EventTopic" {
        displayName "Event Notifications"
        lambdaSubscription { handler processorFunc }
    }
}

Lambda Subscription with Filter Policy

Filter which messages trigger the Lambda function based on message attributes.

stack "FilteredLambdaStack" {
    let! processorFunc =
        lambda "FilteredProcessor" {
            handler "App::ProcessEvent"
            runtime Runtime.DOTNET_8
            code (Code.FromAsset("./lambda"))
        }

    topic "FilteredEventTopic" {
        displayName "Filtered Events"

        lambdaSubscription {
            handler processorFunc

            filterPolicy (
                dict
                    [ "eventType",
                      SubscriptionFilter.StringFilter(StringConditions(Allowlist = [| "order"; "payment" |])) ]
            )
        }
    }
}

SQS Subscription

Subscribe an SQS queue to receive messages from an SNS topic. This is the foundation of the fan-out pattern.

stack "SQSSubscriptionStack" {
    // Create SQS queue using FsCDK builder
    let! orderQueue = queue "OrderQueue" { visibilityTimeout 30.0 }

    // Create topic with SQS subscription using implicit yield
    topic "OrderEvents" {
        displayName "Order Processing Events"

        sqsSubscription {
            queue orderQueue
            rawMessageDelivery true // Send raw message without SNS metadata
        }
    }
}

SQS Subscription with Dead Letter Queue

Configure a dead letter queue to capture messages that fail to deliver.

stack "SQSWithDLQStack" {
    let! orderQueue = queue "OrderQueue" { visibilityTimeout 30.0 }
    let! dlqQueue = queue "DLQ" { retentionPeriod 1209600.0 } // 14 days

    topic "ReliableEvents" {
        displayName "Reliable Event Delivery"

        sqsSubscription {
            queue orderQueue
            deadLetterQueue dlqQueue
            rawMessageDelivery true
        }
    }
}

Email Subscription

Subscribe an email address to receive notifications. The email address will receive a confirmation email and must confirm before receiving messages.

let topicWithEmail =
    topic "AlertTopic" {
        displayName "System Alerts"
        emailSubscription { email "ops-team@example.com" }
    }

Email Subscription with JSON Format

Send the full SNS notification as JSON instead of just the message body.

let topicWithJsonEmail =
    topic "DetailedAlerts" {
        displayName "Detailed System Alerts"

        emailSubscription {
            email "dev-team@example.com"
            json true // Send full JSON notification
        }
    }

SMS Subscription

Subscribe a phone number to receive SMS notifications. Phone numbers should be in E.164 format (e.g., +1234567890).

let topicWithSms =
    topic "UrgentAlerts" {
        displayName "Urgent Notifications"
        smsSubscription { phoneNumber "+1234567890" }
    }

URL (HTTP/HTTPS) Subscription

Subscribe an HTTP or HTTPS endpoint to receive notifications via webhook. The endpoint must confirm the subscription.

let topicWithUrl =
    topic "WebhookTopic" {
        displayName "Webhook Notifications"

        urlSubscription {
            url "https://api.example.com/webhooks/sns"
            rawMessageDelivery true
        }
    }

URL Subscription with Protocol Override

Explicitly set the protocol (useful when URL doesn't clearly indicate HTTP vs HTTPS).

let topicWithHttps =
    topic "SecureWebhooks" {
        displayName "Secure Webhook Notifications"

        urlSubscription {
            url "https://secure.example.com/notifications"
            protocol SubscriptionProtocol.HTTPS
            rawMessageDelivery true
        }
    }

Multiple Subscriptions

Add multiple subscriptions to a single topic using implicit yields (each subscription builder is automatically added to the topic).

stack "MultiSubscriptionStack" {
    let! notificationQueue = queue "NotificationQueue" { () }

    topic "MultiChannelAlerts" {
        displayName "Multi-Channel Alert System"

        // Notify ops team via email
        emailSubscription { email "ops@example.com" }

        // Send to the processing queue
        sqsSubscription {
            queue notificationQueue
            rawMessageDelivery true
        }

        // Webhook for external integration
        urlSubscription { url "https://slack.example.com/webhook" }

        // SMS for critical alerts
        smsSubscription { phoneNumber "+1987654321" }
    }
}

Fan-Out Pattern with Subscription Builders

The fan-out pattern distributes messages from one SNS topic to multiple SQS queues for parallel processing. Each queue can have different processing characteristics.

stack "FanOutStack" {
    // Create multiple queues for different processing pipelines using FsCDK builders
    let! inventoryQueue = queue "InventoryQueue" { visibilityTimeout 30.0 }
    let! shippingQueue = queue "ShippingQueue" { visibilityTimeout 60.0 }
    let! analyticsQueue = queue "AnalyticsQueue" { visibilityTimeout 120.0 }

    // Create a topic with fan-out to all queues using implicit yields
    topic "OrderEvents" {
        displayName "Order Processing Events"

        subscriptions
            [ sqsSubscription {
                  queue inventoryQueue
                  rawMessageDelivery true
              }

              sqsSubscription {
                  queue shippingQueue
                  rawMessageDelivery true
              }

              sqsSubscription {
                  queue analyticsQueue
                  rawMessageDelivery true
              } ]
    }
}

Filter Policy Examples

Use filter policies to route messages to specific subscribers based on message attributes.

String Matching

stack "FilterPolicyExamplesStack" {
    let! filterExampleFn =
        lambda "FilterExampleFn" {
            handler "App::ProcessEvent"
            runtime Runtime.DOTNET_8
            code (Code.FromAsset("./lambda"))
        }

    // String Matching Filter
    let stringFilterExample =
        lambdaSubscription {
            handler filterExampleFn

            filterPolicy (
                dict
                    [ "eventType",
                      SubscriptionFilter.StringFilter(StringConditions(Allowlist = [| "order"; "refund" |])) ]
            )
        }

    // Numeric Matching Filter
    let numericFilterExample =
        lambdaSubscription {
            handler filterExampleFn

            filterPolicy (
                dict
                    [ "amount",
                      SubscriptionFilter.NumericFilter(
                          NumericConditions(Between = BetweenCondition(Start = 100.0, Stop = 1000.0))
                      ) ]
            )
        }

    // Prefix Matching Filter
    let prefixFilterExample =
        lambdaSubscription {
            handler filterExampleFn

            filterPolicy (
                dict
                    [ "source",
                      SubscriptionFilter.StringFilter(StringConditions(MatchPrefixes = [| "prod-"; "staging-" |])) ]
            )
        }

    // Use filters in a topic
    topic "FilteredTopic" {
        displayName "Topic with Filtered Subscriptions"
        stringFilterExample
        numericFilterExample
        prefixFilterExample
    }
}

Best Practices

SNS Best Practices

Performance

Security

Cost Optimization

Reliability

SQS Best Practices

Performance

Security

Cost Optimization

Reliability

Message Processing Patterns

Fan-Out (SNS to Multiple SQS)

Queue Chain (SQS to Lambda to SQS)

Priority Queue

Circuit Breaker

SNS vs SQS

Feature

SNS

SQS

Pattern

Pub/Sub (push)

Queue (pull)

Delivery

Push to subscribers

Pull by consumers

Message Persistence

No

Yes (up to 14 days)

Subscribers

Multiple

One consumer per message

Ordering

FIFO topics only

FIFO queues only

Best For

Fan-out, notifications

Decoupling, buffering

FIFO vs Standard

Feature

Standard

FIFO

Throughput

Unlimited

300 msg/s (batch: 3000)

Ordering

Best effort

Guaranteed

Delivery

At least once

Exactly once

Cost

Lower

Higher

Use Case

Most scenarios

Banking, trading

Subscription Builder Reference

LambdaSubscriptionBuilder

Operation

Type

Description

handler

IFunction

Required. Lambda function to invoke

deadLetterQueue

IQueue

Queue for failed deliveries

filterPolicy

IDictionary<string, SubscriptionFilter>

Filter by message attributes

filterPolicyWithMessageBody

IDictionary<string, FilterOrPolicy>

Filter by message body

SqsSubscriptionBuilder

Operation

Type

Description

queue

IQueue

Required. SQS queue to subscribe

rawMessageDelivery

bool

Send raw message without SNS envelope

deadLetterQueue

IQueue

Queue for failed deliveries

filterPolicy

IDictionary<string, SubscriptionFilter>

Filter by message attributes

filterPolicyWithMessageBody

IDictionary<string, FilterOrPolicy>

Filter by message body

EmailSubscriptionBuilder

Operation

Type

Description

email

string

Required. Email address to subscribe

json

bool

Send full JSON notification

deadLetterQueue

IQueue

Queue for failed deliveries

filterPolicy

IDictionary<string, SubscriptionFilter>

Filter by message attributes

filterPolicyWithMessageBody

IDictionary<string, FilterOrPolicy>

Filter by message body

SmsSubscriptionBuilder

Operation

Type

Description

phoneNumber

string

Required. Phone number (E.164 format)

deadLetterQueue

IQueue

Queue for failed deliveries

filterPolicy

IDictionary<string, SubscriptionFilter>

Filter by message attributes

filterPolicyWithMessageBody

IDictionary<string, FilterOrPolicy>

Filter by message body

UrlSubscriptionBuilder

Operation

Type

Description

url

string

Required. HTTP/HTTPS endpoint URL

protocol

SubscriptionProtocol

HTTP or HTTPS protocol

rawMessageDelivery

bool

Send raw message without SNS envelope

deadLetterQueue

IQueue

Queue for failed deliveries

filterPolicy

IDictionary<string, SubscriptionFilter>

Filter by message attributes

filterPolicyWithMessageBody

IDictionary<string, FilterOrPolicy>

Filter by message body

Resources

namespace FsCDK
namespace Amazon
namespace Amazon.CDK
namespace Amazon.CDK.AWS
namespace Amazon.CDK.AWS.SNS
namespace Amazon.CDK.AWS.SNS.Subscriptions
namespace Amazon.CDK.AWS.SQS
namespace Amazon.CDK.AWS.Lambda
val stack: name: string -> StackBuilder
<summary>Creates an AWS CDK Stack construct.</summary>
<param name="name">The name of the stack.</param>
<code lang="fsharp"> stack "MyStack" { lambda myFunction bucket myBucket } </code>
val topic: name: string -> TopicBuilder
<summary>Creates an SNS topic configuration.</summary>
<param name="name">The topic name.</param>
<code lang="fsharp"> topic "MyTopic" { displayName "My Notification Topic" fifo true } </code>
custom operation: displayName (string) Calls TopicBuilder.DisplayName
<summary>Sets the display name for the topic.</summary>
<param name="displayName">The display name shown in email notifications.</param>
<code lang="fsharp"> topic "MyTopic" { displayName "Order Notifications" } </code>
custom operation: fifo (bool) Calls TopicBuilder.Fifo
<summary>Configures the topic as a FIFO topic.</summary>
<param name="isFifo">Whether the topic is FIFO.</param>
<code lang="fsharp"> topic "MyTopic.fifo" { fifo true } </code>
custom operation: contentBasedDeduplication (bool) Calls TopicBuilder.ContentBasedDeduplication
<summary>Enables content-based deduplication for FIFO topics.</summary>
<param name="enabled">Whether content-based deduplication is enabled.</param>
<code lang="fsharp"> topic "MyTopic.fifo" { fifo true contentBasedDeduplication true } </code>
custom operation: constructId (string) Calls TopicBuilder.ConstructId
<summary>Sets the construct ID for the topic.</summary>
<param name="config">The topic configuration.</param>
<param name="id">The construct ID.</param>
<code lang="fsharp"> topic "MyTopic" { constructId "MyTopicConstruct" } </code>
custom operation: enforceSSL (bool) Calls TopicBuilder.EnforceSSL
<summary>Enforces SSL/TLS for all topic communications.</summary>
<param name="config">The topic configuration.</param>
<param name="enforce">Whether to enforce SSL.</param>
<code lang="fsharp"> topic "MyTopic" { enforceSSL true } </code>
custom operation: signatureVersion (string) Calls TopicBuilder.SignatureVersion
<summary>Sets the signature version for message signing.</summary>
<param name="config">The topic configuration.</param>
<param name="version">The signature version (e.g., "1" or "2").</param>
<code lang="fsharp"> topic "MyTopic" { signatureVersion "2" } </code>
custom operation: tracingConfig (TracingConfig) Calls TopicBuilder.TracingConfig
<summary>Enables tracing configuration for the topic.</summary>
<param name="config">The topic configuration.</param>
<param name="tracingConfig">The tracing configuration (Active or PassThrough).</param>
<code lang="fsharp"> topic "MyTopic" { tracingConfig TracingConfig.ACTIVE } </code>
[<Struct>] type TracingConfig = | PASS_THROUGH = 0 | ACTIVE = 1
field TracingConfig.ACTIVE: TracingConfig = 1
custom operation: messageRetentionPeriodInDays (float) Calls TopicBuilder.MessageRetentionPeriodInDays
<summary>Sets the message retention period in days.</summary>
<param name="config">The topic configuration.</param>
<param name="days">Number of days to retain messages.</param>
<code lang="fsharp"> topic "MyTopic" { messageRetentionPeriodInDays 7.0 } </code>
val queue: name: string -> QueueBuilder
<summary>Creates an SQS queue configuration.</summary>
<param name="name">The queue name.</param>
<code lang="fsharp"> queue "MyQueue" { visibilityTimeout 30.0 fifo true } </code>
custom operation: visibilityTimeout (float) Calls QueueBuilder.VisibilityTimeout
<summary>Sets the visibility timeout for messages in the queue.</summary>
<param name="config">The queue configuration.</param>
<param name="seconds">The visibility timeout in seconds.</param>
<code lang="fsharp"> queue "MyQueue" { visibilityTimeout 30.0 } </code>
custom operation: retentionPeriod (float) Calls QueueBuilder.RetentionPeriod
<summary>Sets the message retention period for the queue.</summary>
<param name="config">The queue configuration.</param>
<param name="seconds">The retention period in seconds.</param>
<code lang="fsharp"> queue "MyQueue" { retentionPeriod 345600.0 // 4 days } </code>
custom operation: fifo (bool) Calls QueueBuilder.Fifo
<summary>Configures the queue as a FIFO queue.</summary>
<param name="config">The queue configuration.</param>
<param name="isFifo">Whether the queue is FIFO.</param>
<code lang="fsharp"> queue "MyQueue.fifo" { fifo true } </code>
custom operation: contentBasedDeduplication (bool) Calls QueueBuilder.ContentBasedDeduplication
<summary>Enables content-based deduplication for FIFO queues.</summary>
<param name="config">The queue configuration.</param>
<param name="enabled">Whether content-based deduplication is enabled.</param>
<code lang="fsharp"> queue "MyQueue.fifo" { fifo true contentBasedDeduplication true } </code>
val dlqQueue: IQueue
val dlqConfig: IDeadLetterQueue
val deadLetterQueue: DeadLetterBuilder
<summary>Creates a dead-letter queue configuration.</summary>
<code lang="fsharp"> deadLetterQueue { queue myDeadLetterQueue maxReceiveCount 5 } </code>
custom operation: queue (IQueue) Calls DeadLetterBuilder.Queue
<summary>Sets the queue that will receive dead letters.</summary>
<param name="config">The dead-letter queue configuration.</param>
<param name="queue">The queue to use as the dead-letter queue.</param>
<code lang="fsharp"> deadLetterQueue { queue myDeadLetterQueue maxReceiveCount 5 } </code>
custom operation: maxReceiveCount (int) Calls DeadLetterBuilder.MaxReceiveCount
<summary>Sets the maximum number of times a message can be delivered to the source queue before being moved to the dead-letter queue.</summary>
<param name="config">The dead-letter queue configuration.</param>
<param name="count">The maximum receive count.</param>
<code lang="fsharp"> deadLetterQueue { maxReceiveCount 10 } </code>
custom operation: deadLetterQueue (IDeadLetterQueue) Calls QueueBuilder.DeadLetterQueue
<summary>Configures a dead-letter queue for the queue.</summary>
<param name="config">The queue configuration.</param>
<param name="deadLetterQueue">The dead-letter queue configuration.</param>
<code lang="fsharp"> queue "MyQueue" { deadLetterQueue myDeadLetterQueue } </code>
val processorFunc: IFunction
val lambda: name: string -> FunctionBuilder
<summary>Creates a Lambda function configuration.</summary>
<param name="name">The function name.</param>
<code lang="fsharp"> lambda "MyFunction" { handler "index.handler" runtime Runtime.NODEJS_18_X code "./lambda" timeout 30.0 } </code>
custom operation: handler (string) Calls FunctionBuilder.Handler
<summary>Sets the handler for the Lambda function.</summary>
<param name="config">The function configuration.</param>
<param name="handler">The handler name (e.g., "index.handler").</param>
<code lang="fsharp"> lambda "MyFunction" { handler "index.handler" } </code>
custom operation: runtime (Runtime) Calls FunctionBuilder.Runtime
<summary>Sets the runtime for the Lambda function.</summary>
<param name="config">The function configuration.</param>
<param name="runtime">The Lambda runtime.</param>
<code lang="fsharp"> lambda "MyFunction" { runtime Runtime.NODEJS_18_X } </code>
Multiple items
type Runtime = inherit DeputyBase new: name: string * ?family: Nullable<RuntimeFamily> * ?props: ILambdaRuntimeProps -> unit member RuntimeEquals: other: Runtime -> bool member ToString: unit -> string member BundlingImage: DockerImage member Family: Nullable<RuntimeFamily> member IsVariable: bool member Name: string member SupportsCodeGuruProfiling: bool member SupportsInlineCode: bool ...

--------------------
Runtime(name: string, ?family: System.Nullable<RuntimeFamily>, ?props: ILambdaRuntimeProps) : Runtime
property Runtime.DOTNET_8: Runtime with get
custom operation: code (Code) Calls FunctionBuilder.Code
<summary>Sets the code source from a Code object.</summary>
<param name="config">The function configuration.</param>
<param name="path">The Code object.</param>
<code lang="fsharp"> lambda "MyFunction" { code (Code.FromBucket myBucket "lambda.zip") } </code>
type Code = inherit DeputyBase override Bind: scope: Construct -> ICodeConfig member BindToResource: resource: CfnResource * ?options: IResourceBindOptions -> unit static member FromAsset: path: string * ?options: IAssetOptions -> AssetCode static member FromAssetImage: directory: string * ?props: IAssetImageCodeProps -> AssetImageCode static member FromBucket: bucket: IBucket * key: string * ?objectVersion: string -> S3Code static member FromBucketV2: bucket: IBucket * key: string * ?options: IBucketOptions -> S3CodeV2 static member FromCfnParameters: ?props: ICfnParametersCodeProps -> CfnParametersCode static member FromCustomCommand: output: string * command: string array * ?options: ICustomCommandOptions -> AssetCode static member FromDockerBuild: path: string * ?options: IDockerBuildAssetOptions -> AssetCode ...
Code.FromAsset(path: string, ?options: AWS.S3.Assets.IAssetOptions) : AssetCode
val lambdaSubscription: LambdaSubscriptionBuilder
<summary>Creates a Lambda subscription configuration.</summary>
<code lang="fsharp"> lambdaSubscription { handler myLambdaFunction filterPolicy (dict [ "eventType", SubscriptionFilter.StringFilter(StringConditions(Allowlist = [| "order" |])) ]) } </code>
custom operation: handler (IFunction) Calls LambdaSubscriptionBuilder.Handler
<summary>Sets the Lambda function for the subscription.</summary>
<param name="config">The subscription configuration.</param>
<param name="func">The Lambda function to subscribe.</param>
<code lang="fsharp"> lambdaSubscription { handler myLambdaFunction } </code>
custom operation: filterPolicy (System.Collections.Generic.IDictionary<string,SubscriptionFilter>) Calls LambdaSubscriptionBuilder.FilterPolicy
<summary>Sets a filter policy for the subscription.</summary>
<param name="config">The subscription configuration.</param>
<param name="policy">The filter policy dictionary.</param>
<code lang="fsharp"> lambdaSubscription { fn myFunction filterPolicy (dict [ "eventType", SubscriptionFilter.StringFilter(StringConditions(Allowlist = [| "order" |])) ]) } </code>
val dict: keyValuePairs: ('Key * 'Value) seq -> System.Collections.Generic.IDictionary<'Key,'Value> (requires equality)
Multiple items
type SubscriptionFilter = inherit DeputyBase new: ?conditions: obj array -> unit static member ExistsFilter: unit -> SubscriptionFilter static member NumericFilter: numericConditions: INumericConditions -> SubscriptionFilter static member StringFilter: stringConditions: IStringConditions -> SubscriptionFilter member Conditions: obj array

--------------------
SubscriptionFilter(?conditions: obj array) : SubscriptionFilter
SubscriptionFilter.StringFilter(stringConditions: IStringConditions) : SubscriptionFilter
Multiple items
type StringConditions = interface IStringConditions new: unit -> unit member Allowlist: string array member Denylist: string array member MatchPrefixes: string array member MatchSuffixes: string array

--------------------
StringConditions() : StringConditions
val orderQueue: IQueue
val sqsSubscription: SqsSubscriptionBuilder
<summary>Creates an SQS subscription configuration.</summary>
<code lang="fsharp"> sqsSubscription { queue mySqsQueue rawMessageDelivery true } </code>
custom operation: queue (IQueue) Calls SqsSubscriptionBuilder.Queue
<summary>Sets the SQS queue for the subscription.</summary>
<param name="config">The subscription configuration.</param>
<param name="q">The SQS queue to subscribe.</param>
<code lang="fsharp"> sqsSubscription { queue mySqsQueue } </code>
custom operation: rawMessageDelivery (bool) Calls SqsSubscriptionBuilder.RawMessageDelivery
<summary>Enables raw message delivery (without SNS metadata).</summary>
<param name="config">The subscription configuration.</param>
<param name="enabled">Whether to enable raw message delivery.</param>
<code lang="fsharp"> sqsSubscription { queue myQueue rawMessageDelivery true } </code>
custom operation: deadLetterQueue (IQueue) Calls SqsSubscriptionBuilder.DeadLetterQueue
<summary>Sets a dead-letter queue for failed messages.</summary>
<param name="config">The subscription configuration.</param>
<param name="q">The SQS queue to use as DLQ.</param>
<code lang="fsharp"> sqsSubscription { queue myQueue deadLetterQueue myDlqQueue } </code>
val topicWithEmail: TopicSpec
val emailSubscription: EmailSubscriptionBuilder
<summary>Creates an email subscription configuration.</summary>
<code lang="fsharp"> emailSubscription { email "admin@example.com" json true } </code>
custom operation: email (string) Calls EmailSubscriptionBuilder.Email
<summary>Sets the email address for the subscription.</summary>
<param name="config">The subscription configuration.</param>
<param name="address">The email address to subscribe.</param>
<code lang="fsharp"> emailSubscription { email "admin@example.com" } </code>
val topicWithJsonEmail: TopicSpec
custom operation: json (bool) Calls EmailSubscriptionBuilder.Json
<summary>Sends the full notification JSON to the email address.</summary>
<param name="config">The subscription configuration.</param>
<param name="enabled">Whether to send JSON format.</param>
<code lang="fsharp"> emailSubscription { email "admin@example.com" json true } </code>
val topicWithSms: TopicSpec
val smsSubscription: SmsSubscriptionBuilder
<summary>Creates an SMS subscription configuration.</summary>
<code lang="fsharp"> smsSubscription { phoneNumber "+1234567890" } </code>
custom operation: phoneNumber (string) Calls SmsSubscriptionBuilder.PhoneNumber
<summary>Sets the phone number for the subscription.</summary>
<param name="config">The subscription configuration.</param>
<param name="number">The phone number to subscribe (E.164 format recommended).</param>
<code lang="fsharp"> smsSubscription { phoneNumber "+1234567890" } </code>
val topicWithUrl: TopicSpec
val urlSubscription: UrlSubscriptionBuilder
<summary>Creates a URL subscription configuration.</summary>
<code lang="fsharp"> urlSubscription { url "https://example.com/webhook" rawMessageDelivery true } </code>
custom operation: url (string) Calls UrlSubscriptionBuilder.Url
<summary>Sets the URL endpoint for the subscription.</summary>
<param name="config">The subscription configuration.</param>
<param name="endpoint">The HTTP/HTTPS URL to subscribe.</param>
<code lang="fsharp"> urlSubscription { url "https://example.com/webhook" } </code>
custom operation: rawMessageDelivery (bool) Calls UrlSubscriptionBuilder.RawMessageDelivery
<summary>Enables raw message delivery (without SNS metadata).</summary>
<param name="config">The subscription configuration.</param>
<param name="enabled">Whether to enable raw message delivery.</param>
<code lang="fsharp"> urlSubscription { url "https://example.com/webhook" rawMessageDelivery true } </code>
val topicWithHttps: TopicSpec
custom operation: protocol (SubscriptionProtocol) Calls UrlSubscriptionBuilder.Protocol
<summary>Sets the protocol for the subscription (HTTP or HTTPS).</summary>
<param name="config">The subscription configuration.</param>
<param name="proto">The subscription protocol.</param>
<code lang="fsharp"> urlSubscription { url "https://example.com/webhook" protocol SubscriptionProtocol.HTTPS } </code>
[<Struct>] type SubscriptionProtocol = | HTTP = 0 | HTTPS = 1 | EMAIL = 2 | EMAIL_JSON = 3 | SMS = 4 | SQS = 5 | APPLICATION = 6 | LAMBDA = 7 | FIREHOSE = 8
field SubscriptionProtocol.HTTPS: SubscriptionProtocol = 1
val notificationQueue: IQueue
val inventoryQueue: IQueue
val shippingQueue: IQueue
val analyticsQueue: IQueue
custom operation: subscriptions (ITopicSubscription list) Calls TopicBuilder.Subscriptions
<summary>Adds multiple subscriptions to the topic.</summary>
<param name="config">The topic configuration.</param>
<param name="subscriptions">The subscriptions to add.</param>
<code lang="fsharp"> topic "MyTopic" { subscriptions [ lambdaSubscription { handler myFunction } sqsSubscription { queue myQueue } ] } </code>
val filterExampleFn: IFunction
val stringFilterExample: ITopicSubscription
val numericFilterExample: ITopicSubscription
SubscriptionFilter.NumericFilter(numericConditions: INumericConditions) : SubscriptionFilter
Multiple items
type NumericConditions = interface INumericConditions new: unit -> unit member Allowlist: float array member Between: IBetweenCondition member BetweenStrict: IBetweenCondition member GreaterThan: Nullable<float> member GreaterThanOrEqualTo: Nullable<float> member LessThan: Nullable<float> member LessThanOrEqualTo: Nullable<float>

--------------------
NumericConditions() : NumericConditions
Multiple items
type BetweenCondition = interface IBetweenCondition new: unit -> unit member Start: float member Stop: float

--------------------
BetweenCondition() : BetweenCondition
val prefixFilterExample: ITopicSubscription

Type something to start searching.