Skip to content

Comments

fix: sns - sqs builder#23

Merged
edgarfgp merged 3 commits intomainfrom
fix-sqs-builder
Dec 10, 2025
Merged

fix: sns - sqs builder#23
edgarfgp merged 3 commits intomainfrom
fix-sqs-builder

Conversation

@edgarfgp
Copy link
Collaborator

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the SNS subscription system and introduces a new type-safe dead-letter queue builder for SQS. The changes replace the old string-based subscription mechanism with strongly-typed builders that leverage CDK's native ITopicSubscription interface.

Key Changes

  • Added five new SNS subscription builders (lambdaSubscription, sqsSubscription, emailSubscription, smsSubscription, urlSubscription) that return ITopicSubscription and can be implicitly yielded into topics
  • Introduced a deadLetterQueue builder in SQS that creates IDeadLetterQueue configurations for proper DLQ setup
  • Removed the old SubscriptionOp and SubscriptionSpec types along with the string-based subscription mechanism from Stack.fs
  • Updated topic builder to support subscriptions via implicit yield, explicit subscription operation, and subscriptions list operation

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/SNS.fs Complete rewrite of subscription system with five new type-safe builders (Lambda, SQS, Email, SMS, URL) and updated TopicBuilder to support subscriptions
src/SQS.fs Added DeadLetterBuilder for creating IDeadLetterQueue configurations; updated QueueBuilder to use IDeadLetterQueue instead of string-based DLQ references
src/Stack.fs Removed old SubscriptionOp and processSubscription logic; added subscription processing in TopicOp that iterates through subscriptions and calls topic.AddSubscription
src/Stage.fs Fixed typo in comment ("onfiguration" → "configuration")
tests/SNSTests.fs Comprehensive test suite for all new subscription builders with 100+ test cases covering standalone usage, integration with stack CE, and various configuration options
tests/SQSTests.fs Added tests for deadLetterQueue builder both standalone and within stack CE; updated existing DLQ test to use new builder pattern
tests/SecurityDefaultsTests.fs Added testSequenced to all test lists for sequential execution consistency
tests/FsCdk.Tests.fsproj Added SNSTests.fs to compilation order
tests/AppTests.fs Updated example to use new deadLetterQueue builder with let! binding pattern
docs/sns-sqs-messaging.fsx Extensive documentation rewrite with examples for all subscription builders, filter policies, fan-out patterns, and comprehensive reference tables
docs/index.fsx Updated example to use new deadLetterQueue builder pattern
CHANGELOG.md Added v0.2.0 release notes documenting new features and fixes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@edgarfgp edgarfgp marked this pull request as ready for review December 10, 2025 21:22
@edgarfgp edgarfgp merged commit ba97184 into main Dec 10, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant