From bce5654c0b70c960883d608140067916576ed923 Mon Sep 17 00:00:00 2001 From: edgargonzalez Date: Tue, 2 Dec 2025 15:08:22 +0000 Subject: [PATCH 1/5] fix: sqs builder --- src/SQS.fs | 218 +++++++++++++++++++++++++++++++++++---- tests/FsCdk.Tests.fsproj | 1 + tests/SQSTests.fs | 151 +++++++++++++++++++++++++++ 3 files changed, 349 insertions(+), 21 deletions(-) create mode 100644 tests/SQSTests.fs diff --git a/src/SQS.fs b/src/SQS.fs index 2adf4e1..2e7377f 100644 --- a/src/SQS.fs +++ b/src/SQS.fs @@ -11,15 +11,25 @@ open Amazon.CDK.AWS.KMS // SQS Queue configuration DSL type QueueConfig = { QueueName: string - ConstructId: string option // Optional custom construct ID - VisibilityTimeout: float option // seconds - MessageRetention: float option // seconds + ConstructId: string option + VisibilityTimeout: float option + RetentionPeriod: float option FifoQueue: bool option ContentBasedDeduplication: bool option - MaxReceiveCount: int option // for DLQ - DeadLetterQueueName: string option // Reference to DLQ - DelaySeconds: int option + MaxReceiveCount: int option + DeadLetterQueueName: string option + DeadLetterQueue: IDeadLetterQueue option + DeduplicationScope: DeduplicationScope option + DeliveryDelay: Duration option + DataKeyReuse: Duration option Encryption: QueueEncryption option + EnforceSSL: bool option + Fifo: bool option + FifoThroughputLimit: FifoThroughputLimit option + MaxMessageSizeBytes: float option + ReceiveMessageWaitTime: Duration option + RedriveAllowPolicy: IRedriveAllowPolicy option + RemovalPolicy: RemovalPolicy option EncryptionMasterKey: IKey option } type QueueSpec = @@ -33,26 +43,46 @@ type QueueBuilder(name: string) = { QueueName = name ConstructId = None VisibilityTimeout = None - MessageRetention = None + RetentionPeriod = None FifoQueue = None ContentBasedDeduplication = None MaxReceiveCount = None DeadLetterQueueName = None - DelaySeconds = None + DeadLetterQueue = None + DeduplicationScope = None + DeliveryDelay = None + DataKeyReuse = None Encryption = None + EnforceSSL = None + Fifo = None + FifoThroughputLimit = None + MaxMessageSizeBytes = None + ReceiveMessageWaitTime = None + RedriveAllowPolicy = None + RemovalPolicy = None EncryptionMasterKey = None } member _.Zero() : QueueConfig = { QueueName = name ConstructId = None VisibilityTimeout = None - MessageRetention = None + RetentionPeriod = None FifoQueue = None ContentBasedDeduplication = None MaxReceiveCount = None DeadLetterQueueName = None - DelaySeconds = None + DeadLetterQueue = None + DeduplicationScope = None + DeliveryDelay = None + DataKeyReuse = None Encryption = None + EnforceSSL = None + Fifo = None + FifoThroughputLimit = None + MaxMessageSizeBytes = None + ReceiveMessageWaitTime = None + RedriveAllowPolicy = None + RemovalPolicy = None EncryptionMasterKey = None } member inline _.Delay([] f: unit -> QueueConfig) : QueueConfig = f () @@ -61,15 +91,25 @@ type QueueBuilder(name: string) = { QueueName = state1.QueueName ConstructId = state2.ConstructId |> Option.orElse state1.ConstructId VisibilityTimeout = state2.VisibilityTimeout |> Option.orElse state1.VisibilityTimeout - MessageRetention = state2.MessageRetention |> Option.orElse state1.MessageRetention + RetentionPeriod = state2.RetentionPeriod |> Option.orElse state1.RetentionPeriod FifoQueue = state2.FifoQueue |> Option.orElse state1.FifoQueue ContentBasedDeduplication = state2.ContentBasedDeduplication |> Option.orElse state1.ContentBasedDeduplication MaxReceiveCount = state2.MaxReceiveCount |> Option.orElse state1.MaxReceiveCount DeadLetterQueueName = state2.DeadLetterQueueName |> Option.orElse state1.DeadLetterQueueName - DelaySeconds = state2.DelaySeconds |> Option.orElse state1.DelaySeconds + DeadLetterQueue = state2.DeadLetterQueue |> Option.orElse state1.DeadLetterQueue + DeduplicationScope = state2.DeduplicationScope |> Option.orElse state1.DeduplicationScope + DeliveryDelay = state2.DeliveryDelay |> Option.orElse state1.DeliveryDelay + DataKeyReuse = state2.DataKeyReuse |> Option.orElse state1.DataKeyReuse Encryption = state2.Encryption |> Option.orElse state1.Encryption + EnforceSSL = state2.EnforceSSL |> Option.orElse state1.EnforceSSL + Fifo = state2.Fifo |> Option.orElse state1.Fifo + FifoThroughputLimit = state2.FifoThroughputLimit |> Option.orElse state1.FifoThroughputLimit + MaxMessageSizeBytes = state2.MaxMessageSizeBytes |> Option.orElse state1.MaxMessageSizeBytes + ReceiveMessageWaitTime = state2.ReceiveMessageWaitTime |> Option.orElse state1.ReceiveMessageWaitTime + RedriveAllowPolicy = state2.RedriveAllowPolicy |> Option.orElse state1.RedriveAllowPolicy + RemovalPolicy = state2.RemovalPolicy |> Option.orElse state1.RemovalPolicy EncryptionMasterKey = state2.EncryptionMasterKey |> Option.orElse state1.EncryptionMasterKey } member inline x.For(config: QueueConfig, [] f: unit -> QueueConfig) : QueueConfig = @@ -89,7 +129,7 @@ type QueueBuilder(name: string) = config.VisibilityTimeout |> Option.iter (fun v -> props.VisibilityTimeout <- Duration.Seconds(v)) - config.MessageRetention + config.RetentionPeriod |> Option.iter (fun r -> props.RetentionPeriod <- Duration.Seconds(r)) config.FifoQueue |> Option.iter (fun f -> props.Fifo <- f) @@ -97,21 +137,43 @@ type QueueBuilder(name: string) = config.ContentBasedDeduplication |> Option.iter (fun c -> props.ContentBasedDeduplication <- c) - config.DelaySeconds - |> Option.iter (fun d -> props.DeliveryDelay <- Duration.Seconds(float d)) + config.DeduplicationScope + |> Option.iter (fun d -> props.DeduplicationScope <- d) + + config.DeliveryDelay |> Option.iter (fun d -> props.DeliveryDelay <- d) + + config.DataKeyReuse |> Option.iter (fun d -> props.DataKeyReuse <- d) config.Encryption |> Option.iter (fun e -> props.Encryption <- e) + config.EnforceSSL |> Option.iter (fun e -> props.EnforceSSL <- e) + + config.Fifo |> Option.iter (fun f -> props.Fifo <- f) + + config.FifoThroughputLimit + |> Option.iter (fun f -> props.FifoThroughputLimit <- f) + + config.MaxMessageSizeBytes + |> Option.iter (fun m -> props.MaxMessageSizeBytes <- m) + + config.ReceiveMessageWaitTime + |> Option.iter (fun r -> props.ReceiveMessageWaitTime <- r) + + config.RedriveAllowPolicy + |> Option.iter (fun r -> props.RedriveAllowPolicy <- r) + + config.RemovalPolicy |> Option.iter (fun r -> props.RemovalPolicy <- r) + config.EncryptionMasterKey |> Option.iter (fun k -> props.EncryptionMasterKey <- k) - // Avoid using Amazon.CDK.Duration at spec-build time to keep tests jsii-free { QueueName = queueName ConstructId = constructId Props = props Queue = None } /// Sets the construct ID for the queue. + /// The queue configuration. /// The construct ID. /// /// queue "MyQueue" { @@ -122,6 +184,7 @@ type QueueBuilder(name: string) = member _.ConstructId(config: QueueConfig, id: string) = { config with ConstructId = Some id } /// Sets the visibility timeout for messages in the queue. + /// The queue configuration. /// The visibility timeout in seconds. /// /// queue "MyQueue" { @@ -134,6 +197,7 @@ type QueueBuilder(name: string) = VisibilityTimeout = Some seconds } /// Sets the message retention period for the queue. + /// The queue configuration. /// The retention period in seconds. /// /// queue "MyQueue" { @@ -143,9 +207,10 @@ type QueueBuilder(name: string) = [] member _.MessageRetention(config: QueueConfig, seconds: float) = { config with - MessageRetention = Some seconds } + RetentionPeriod = Some seconds } /// Configures the queue as a FIFO queue. + /// The queue configuration. /// Whether the queue is FIFO. /// /// queue "MyQueue.fifo" { @@ -156,6 +221,7 @@ type QueueBuilder(name: string) = member _.Fifo(config: QueueConfig, isFifo: bool) = { config with FifoQueue = Some isFifo } /// Enables content-based deduplication for FIFO queues. + /// The queue configuration. /// Whether content-based deduplication is enabled. /// /// queue "MyQueue.fifo" { @@ -169,6 +235,7 @@ type QueueBuilder(name: string) = ContentBasedDeduplication = Some enabled } /// Configures a dead-letter queue for the queue. + /// The queue configuration. /// The name of the dead-letter queue. /// Maximum receives before sending to DLQ. /// @@ -183,18 +250,20 @@ type QueueBuilder(name: string) = MaxReceiveCount = Some maxReceiveCount } /// Sets the delay for all messages in the queue. - /// The delay in seconds. + /// The queue configuration. + /// The delay duration. /// /// queue "MyQueue" { - /// delaySeconds 15 + /// delaySeconds (Duration.Seconds(15.0)) /// } /// [] - member _.DelaySeconds(config: QueueConfig, seconds: int) = + member _.DelaySeconds(config: QueueConfig, delay: Duration) = { config with - DelaySeconds = Some seconds } + DeliveryDelay = Some delay } /// Sets the encryption type for the queue. + /// The queue configuration. /// The encryption type (KMS, KMS_MANAGED, SQS_MANAGED, or UNENCRYPTED). /// /// queue "MyQueue" { @@ -207,6 +276,7 @@ type QueueBuilder(name: string) = Encryption = Some encryption } /// Sets the KMS master key for encryption. + /// The queue configuration. /// The KMS key. /// /// queue "MyQueue" { @@ -219,6 +289,112 @@ type QueueBuilder(name: string) = { config with EncryptionMasterKey = Some key } + /// Sets the deduplication scope for FIFO queues. + /// The queue configuration. + /// The deduplication scope (Queue or MessageGroup). + /// + /// queue "MyQueue.fifo" { + /// fifo true + /// deduplicationScope DeduplicationScope.MESSAGE_GROUP + /// } + /// + [] + member _.DeduplicationScope(config: QueueConfig, scope: DeduplicationScope) = + { config with + DeduplicationScope = Some scope } + + /// Enforces SSL/TLS for all queue communications. + /// The queue configuration. + /// Whether to enforce SSL. + /// + /// queue "MyQueue" { + /// enforceSSL true + /// } + /// + [] + member _.EnforceSSL(config: QueueConfig, enforce: bool) = + { config with + EnforceSSL = Some enforce } + + /// Sets the throughput limit for FIFO queues. + /// The queue configuration. + /// The throughput limit (PerQueue or PerMessageGroupId). + /// + /// queue "MyQueue.fifo" { + /// fifo true + /// fifoThroughputLimit FifoThroughputLimit.PER_MESSAGE_GROUP_ID + /// } + /// + [] + member _.FifoThroughputLimit(config: QueueConfig, limit: FifoThroughputLimit) = + { config with + FifoThroughputLimit = Some limit } + + /// Sets the maximum message size in bytes (1,024 to 262,144 bytes). + /// The queue configuration. + /// The maximum message size in bytes. + /// + /// queue "MyQueue" { + /// maxMessageSizeBytes 65536.0 + /// } + /// + [] + member _.MaxMessageSizeBytes(config: QueueConfig, bytes: float) = + { config with + MaxMessageSizeBytes = Some bytes } + + /// Sets the receive message wait time for long polling. + /// The queue configuration. + /// The wait time duration. + /// + /// queue "MyQueue" { + /// receiveMessageWaitTime (Duration.Seconds(20.0)) + /// } + /// + [] + member _.ReceiveMessageWaitTime(config: QueueConfig, duration: Duration) = + { config with + ReceiveMessageWaitTime = Some duration } + + /// Sets the redrive allow policy for this queue. + /// The queue configuration. + /// The redrive allow policy. + /// + /// queue "MyDLQ" { + /// redriveAllowPolicy myRedriveAllowPolicy + /// } + /// + [] + member _.RedriveAllowPolicy(config: QueueConfig, policy: IRedriveAllowPolicy) = + { config with + RedriveAllowPolicy = Some policy } + + /// Sets the removal policy for the queue. + /// The queue configuration. + /// The removal policy (DESTROY, RETAIN, SNAPSHOT, or RETAIN_ON_UPDATE_OR_DELETE). + /// + /// queue "MyQueue" { + /// removalPolicy RemovalPolicy.DESTROY + /// } + /// + [] + member _.RemovalPolicy(config: QueueConfig, policy: RemovalPolicy) = + { config with + RemovalPolicy = Some policy } + + /// Sets the data key reuse period for SSE. + /// The queue configuration. + /// The data key reuse duration. + /// + /// queue "MyQueue" { + /// dataKeyReuse (Duration.Hours(1.0)) + /// } + /// + [] + member _.DataKeyReuse(config: QueueConfig, duration: Duration) = + { config with + DataKeyReuse = Some duration } + // ============================================================================ // Builders // ============================================================================ diff --git a/tests/FsCdk.Tests.fsproj b/tests/FsCdk.Tests.fsproj index f197cf7..cd82220 100644 --- a/tests/FsCdk.Tests.fsproj +++ b/tests/FsCdk.Tests.fsproj @@ -19,6 +19,7 @@ + diff --git a/tests/SQSTests.fs b/tests/SQSTests.fs new file mode 100644 index 0000000..8ce0109 --- /dev/null +++ b/tests/SQSTests.fs @@ -0,0 +1,151 @@ +module FsCDK.Tests.SQSTests + +open Expecto +open FsCDK +open Amazon.CDK +open Amazon.CDK.AWS.SQS + +[] +let sqs_queue_dsl_tests = + testList + "SQS queue DSL" + [ test "defaults constructId to queue name" { + let spec = queue "MyQueue" { () } + + Expect.equal spec.QueueName "MyQueue" "QueueName should be set" + Expect.equal spec.ConstructId "MyQueue" "ConstructId should default to queue name" + } + + test "uses custom constructId when provided" { + let spec = queue "MyQueue" { constructId "MyQueueConstruct" } + + Expect.equal spec.ConstructId "MyQueueConstruct" "Custom constructId should be used" + } + + test "configures FIFO queue" { + let spec = queue "MyQueue.fifo" { fifo true } + + Expect.isTrue spec.Props.Fifo.Value "Queue should be configured as FIFO" + } + + test "enables content-based deduplication" { + let spec = + queue "MyQueue.fifo" { + fifo true + contentBasedDeduplication true + } + + Expect.isTrue spec.Props.ContentBasedDeduplication.Value "ContentBasedDeduplication should be enabled" + } + + test "configures dead-letter queue reference" { + let spec = queue "MyQueue" { deadLetterQueue "MyDLQ" 3 } + + // Note: The actual DLQ connection happens at stack build time + Expect.equal spec.QueueName "MyQueue" "Queue name should be set" + } + + test "applies encryption when configured" { + let spec = queue "MyQueue" { encryption QueueEncryption.KMS_MANAGED } + + Expect.equal spec.Props.Encryption.Value QueueEncryption.KMS_MANAGED "Encryption should be set" + } + + test "applies deduplication scope for FIFO queues" { + let spec = + queue "MyQueue.fifo" { + fifo true + deduplicationScope DeduplicationScope.MESSAGE_GROUP + } + + Expect.equal + spec.Props.DeduplicationScope.Value + DeduplicationScope.MESSAGE_GROUP + "DeduplicationScope should be set" + } + + test "enforces SSL when configured" { + let spec = queue "MyQueue" { enforceSSL true } + + Expect.isTrue spec.Props.EnforceSSL.Value "EnforceSSL should be true" + } + + test "applies FIFO throughput limit" { + let spec = + queue "MyQueue.fifo" { + fifo true + fifoThroughputLimit FifoThroughputLimit.PER_MESSAGE_GROUP_ID + } + + Expect.equal + spec.Props.FifoThroughputLimit.Value + FifoThroughputLimit.PER_MESSAGE_GROUP_ID + "FifoThroughputLimit should be set" + } + + test "applies max message size bytes" { + let spec = queue "MyQueue" { maxMessageSizeBytes 65536.0 } + + Expect.equal spec.Props.MaxMessageSizeBytes.Value 65536.0 "MaxMessageSizeBytes should be set" + } + + test "applies removal policy" { + let spec = queue "MyQueue" { removalPolicy RemovalPolicy.DESTROY } + + Expect.equal spec.Props.RemovalPolicy.Value RemovalPolicy.DESTROY "RemovalPolicy should be set" + } + + test "combines multiple non-Duration configurations" { + let spec = + queue "MyQueue.fifo" { + constructId "MyFifoQueue" + fifo true + contentBasedDeduplication true + deduplicationScope DeduplicationScope.MESSAGE_GROUP + fifoThroughputLimit FifoThroughputLimit.PER_MESSAGE_GROUP_ID + enforceSSL true + maxMessageSizeBytes 131072.0 + removalPolicy RemovalPolicy.RETAIN + } + + Expect.equal spec.ConstructId "MyFifoQueue" "ConstructId should be set" + Expect.isTrue spec.Props.Fifo.Value "Fifo should be true" + Expect.isTrue spec.Props.ContentBasedDeduplication.Value "ContentBasedDeduplication should be true" + + Expect.equal + spec.Props.DeduplicationScope.Value + DeduplicationScope.MESSAGE_GROUP + "DeduplicationScope should be set" + + Expect.equal + spec.Props.FifoThroughputLimit.Value + FifoThroughputLimit.PER_MESSAGE_GROUP_ID + "FifoThroughputLimit should be set" + + Expect.isTrue spec.Props.EnforceSSL.Value "EnforceSSL should be true" + Expect.equal spec.Props.MaxMessageSizeBytes.Value 131072.0 "MaxMessageSizeBytes should be set" + Expect.equal spec.Props.RemovalPolicy.Value RemovalPolicy.RETAIN "RemovalPolicy should be set" + } + + test "optional settings remain unset when not provided" { + let spec = queue "SimpleQueue" { () } + + Expect.isNull (box spec.Props.Fifo) "Fifo should be null when not configured" + + Expect.isNull + (box spec.Props.ContentBasedDeduplication) + "ContentBasedDeduplication should be null when not configured" + + Expect.isNull (box spec.Props.Encryption) "Encryption should be null when not configured" + Expect.isNull (box spec.Props.EnforceSSL) "EnforceSSL should be null when not configured" + + Expect.isNull + (box spec.Props.FifoThroughputLimit) + "FifoThroughputLimit should be null when not configured" + + Expect.isNull + (box spec.Props.MaxMessageSizeBytes) + "MaxMessageSizeBytes should be null when not configured" + + Expect.isNull (box spec.Props.RemovalPolicy) "RemovalPolicy should be null when not configured" + } ] From 6d0cb13f4a7395f60be94f449e2b805a7e630f80 Mon Sep 17 00:00:00 2001 From: edgargonzalez Date: Tue, 2 Dec 2025 16:28:24 +0000 Subject: [PATCH 2/5] fix naming --- src/SQS.fs | 20 +++++++------------- tests/AppTests.fs | 2 +- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/SQS.fs b/src/SQS.fs index 2e7377f..3491c1f 100644 --- a/src/SQS.fs +++ b/src/SQS.fs @@ -14,7 +14,6 @@ type QueueConfig = ConstructId: string option VisibilityTimeout: float option RetentionPeriod: float option - FifoQueue: bool option ContentBasedDeduplication: bool option MaxReceiveCount: int option DeadLetterQueueName: string option @@ -44,7 +43,6 @@ type QueueBuilder(name: string) = ConstructId = None VisibilityTimeout = None RetentionPeriod = None - FifoQueue = None ContentBasedDeduplication = None MaxReceiveCount = None DeadLetterQueueName = None @@ -67,7 +65,6 @@ type QueueBuilder(name: string) = ConstructId = None VisibilityTimeout = None RetentionPeriod = None - FifoQueue = None ContentBasedDeduplication = None MaxReceiveCount = None DeadLetterQueueName = None @@ -92,7 +89,6 @@ type QueueBuilder(name: string) = ConstructId = state2.ConstructId |> Option.orElse state1.ConstructId VisibilityTimeout = state2.VisibilityTimeout |> Option.orElse state1.VisibilityTimeout RetentionPeriod = state2.RetentionPeriod |> Option.orElse state1.RetentionPeriod - FifoQueue = state2.FifoQueue |> Option.orElse state1.FifoQueue ContentBasedDeduplication = state2.ContentBasedDeduplication |> Option.orElse state1.ContentBasedDeduplication @@ -132,8 +128,6 @@ type QueueBuilder(name: string) = config.RetentionPeriod |> Option.iter (fun r -> props.RetentionPeriod <- Duration.Seconds(r)) - config.FifoQueue |> Option.iter (fun f -> props.Fifo <- f) - config.ContentBasedDeduplication |> Option.iter (fun c -> props.ContentBasedDeduplication <- c) @@ -201,11 +195,11 @@ type QueueBuilder(name: string) = /// The retention period in seconds. /// /// queue "MyQueue" { - /// messageRetention 345600.0 // 4 days + /// retentionPeriod 345600.0 // 4 days /// } /// - [] - member _.MessageRetention(config: QueueConfig, seconds: float) = + [] + member _.RetentionPeriod(config: QueueConfig, seconds: float) = { config with RetentionPeriod = Some seconds } @@ -218,7 +212,7 @@ type QueueBuilder(name: string) = /// } /// [] - member _.Fifo(config: QueueConfig, isFifo: bool) = { config with FifoQueue = Some isFifo } + member _.Fifo(config: QueueConfig, isFifo: bool) = { config with Fifo = Some isFifo } /// Enables content-based deduplication for FIFO queues. /// The queue configuration. @@ -254,11 +248,11 @@ type QueueBuilder(name: string) = /// The delay duration. /// /// queue "MyQueue" { - /// delaySeconds (Duration.Seconds(15.0)) + /// deliveryDelay (Duration.Seconds(15.0)) /// } /// - [] - member _.DelaySeconds(config: QueueConfig, delay: Duration) = + [] + member _.DeliveryDelay(config: QueueConfig, delay: Duration) = { config with DeliveryDelay = Some delay } diff --git a/tests/AppTests.fs b/tests/AppTests.fs index c1f816f..dde321b 100644 --- a/tests/AppTests.fs +++ b/tests/AppTests.fs @@ -48,7 +48,7 @@ let appTests = } queue "users-dlq" { - messageRetention (7.0 * 24.0 * 3600.0) // 7 days + retentionPeriod (7.0 * 24.0 * 3600.0) // 7 days } queue "users-queue" { From f8278d2e44b1b2277f23cb461f95ecfa56c65853 Mon Sep 17 00:00:00 2001 From: edgargonzalez Date: Tue, 2 Dec 2025 17:44:41 +0000 Subject: [PATCH 3/5] fix docs --- docs/index.fsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.fsx b/docs/index.fsx index 70c63d0..1e3d624 100644 --- a/docs/index.fsx +++ b/docs/index.fsx @@ -62,7 +62,7 @@ stack "Dev" { } queue "users-dlq" { - messageRetention (7.0 * 24.0 * 3600.0) // 7 days + retentionPeriod (7.0 * 24.0 * 3600.0) // 7 days } queue "users-queue" { From 2aece60855bbc6b7aa03928e3cd8028021c09188 Mon Sep 17 00:00:00 2001 From: edgargonzalez Date: Tue, 2 Dec 2025 18:05:41 +0000 Subject: [PATCH 4/5] fix docs --- docs/index.fsx | 2 +- docs/lambda-production-defaults.fsx | 2 +- docs/sns-sqs-messaging.fsx | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/index.fsx b/docs/index.fsx index 1e3d624..208a3ed 100644 --- a/docs/index.fsx +++ b/docs/index.fsx @@ -205,7 +205,7 @@ table th { | **KMS Key** | `kmsKey` | `admissionPrincipal`, `alias`, `constructId`, `description`, `disableKeyRotation`, `enableKeyRotation`, `enabled`, `keySpec`, `keyUsage`, `pendingWindow`, `policy`, `removalPolicy` | | **LambdaRole** | `lambdaRole` | `assumeRolePrincipal`, `basicExecution`, `constructId`, `inlinePolicy`, `kmsDecrypt`, `managedPolicy`, `vpcExecution`, `xrayTracing` | | **Origin Access Identity** | `originAccessIdentity` | `constructId`, `comment` | -| **Queue** | `queue` | `constructId`, `contentBasedDeduplication`, `deadLetterQueue`, `delaySeconds`, `fifo`, `messageRetention`, `visibilityTimeout` | +| **Queue** | `queue` | `constructId`, `contentBasedDeduplication`, `deadLetterQueue`, `delaySeconds`, `fifo`, `retentionPeriod`, `visibilityTimeout` | | **RDS Proxy** | `rdsProxy` | `constructId`, `debugLogging`, `iamAuth`, `idleClientTimeout`, `initQuery`, `maxConnectionsPercent`, `maxIdleConnectionsPercent`, `proxyTarget`, `requireTLS`, `secrets`, `sessionPinningFilters`, `vpc` | | **REST API (API Gateway V1)** | `restApi` | `binaryMediaTypes`, `cloneFrom`, `constructId`, `defaultCorsPreflightOptions`, `defaultIntegration`, `defaultMethodOptions`, `deployOptions`, `description`, `disableExecuteApiEndpoint`, `endpointTypes`, `failOnWarnings`, `parameters`, `policy`, `restApiName`, `retainDeployments` | | **Route53 ARecord** | `aRecord` | `comment`, `constructId`, `target`, `ttl`, `zone` | diff --git a/docs/lambda-production-defaults.fsx b/docs/lambda-production-defaults.fsx index e407dd4..6a842c7 100644 --- a/docs/lambda-production-defaults.fsx +++ b/docs/lambda-production-defaults.fsx @@ -153,7 +153,7 @@ stack "CustomDLQStack" { // Create custom DLQ with specific settings let! customDlq = queue "critical-failures" { - messageRetention (30.0 * 24.0 * 3600.0) // 30 days in seconds + retentionPeriod (30.0 * 24.0 * 3600.0) // 30 days in seconds encryption QueueEncryption.KMS } diff --git a/docs/sns-sqs-messaging.fsx b/docs/sns-sqs-messaging.fsx index 6b72aab..d90f28b 100644 --- a/docs/sns-sqs-messaging.fsx +++ b/docs/sns-sqs-messaging.fsx @@ -60,7 +60,7 @@ Create a simple SQS queue for asynchronous message processing. stack "BasicSQS" { queue "OrderProcessing" { visibilityTimeout 30.0 - messageRetention 345600.0 // 4 days + retentionPeriod 345600.0 // 4 days } } @@ -88,7 +88,7 @@ stack "QueueWithDLQ" { // Create dead-letter queue first let dlq = queue "ProcessingDLQ" { - messageRetention 1209600.0 // 14 days + retentionPeriod 1209600.0 // 14 days } // Create main queue with DLQ From aa021392b9fcd07aa2ff80c9745a950d8003d298 Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Tue, 2 Dec 2025 20:28:47 +0000 Subject: [PATCH 5/5] Update docs/index.fsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- docs/index.fsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.fsx b/docs/index.fsx index 208a3ed..4f1f8fa 100644 --- a/docs/index.fsx +++ b/docs/index.fsx @@ -205,7 +205,7 @@ table th { | **KMS Key** | `kmsKey` | `admissionPrincipal`, `alias`, `constructId`, `description`, `disableKeyRotation`, `enableKeyRotation`, `enabled`, `keySpec`, `keyUsage`, `pendingWindow`, `policy`, `removalPolicy` | | **LambdaRole** | `lambdaRole` | `assumeRolePrincipal`, `basicExecution`, `constructId`, `inlinePolicy`, `kmsDecrypt`, `managedPolicy`, `vpcExecution`, `xrayTracing` | | **Origin Access Identity** | `originAccessIdentity` | `constructId`, `comment` | -| **Queue** | `queue` | `constructId`, `contentBasedDeduplication`, `deadLetterQueue`, `delaySeconds`, `fifo`, `retentionPeriod`, `visibilityTimeout` | +| **Queue** | `queue` | `constructId`, `contentBasedDeduplication`, `dataKeyReuse`, `deadLetterQueue`, `deduplicationScope`, `deliveryDelay`, `encryption`, `encryptionMasterKey`, `enforceSSL`, `fifo`, `fifoThroughputLimit`, `maxMessageSizeBytes`, `receiveMessageWaitTime`, `redriveAllowPolicy`, `removalPolicy`, `retentionPeriod`, `visibilityTimeout` | | **RDS Proxy** | `rdsProxy` | `constructId`, `debugLogging`, `iamAuth`, `idleClientTimeout`, `initQuery`, `maxConnectionsPercent`, `maxIdleConnectionsPercent`, `proxyTarget`, `requireTLS`, `secrets`, `sessionPinningFilters`, `vpc` | | **REST API (API Gateway V1)** | `restApi` | `binaryMediaTypes`, `cloneFrom`, `constructId`, `defaultCorsPreflightOptions`, `defaultIntegration`, `defaultMethodOptions`, `deployOptions`, `description`, `disableExecuteApiEndpoint`, `endpointTypes`, `failOnWarnings`, `parameters`, `policy`, `restApiName`, `retainDeployments` | | **Route53 ARecord** | `aRecord` | `comment`, `constructId`, `target`, `ttl`, `zone` |