Vignesh Rajagopalan
04/27/2021, 3:49 PMFrank
deliveryPolicy
in the sns.Subscription
construct yet.Frank
sst.Topic
construct exposed the `sns.Subscription`s it created internally, and you can the CloudFormation resource from it and set the deliveryPolicy
at the CloudFormation level. It would look something like:
const topic = sst.Topic(...);
topic.snsSubscriptions[0].node.defaultChild.deliveryPolicy = {
throttlePolicy: { "maxReceivesPerSecond": 10 }
};
Frank
.node.defaultChild
gives you the low level CloudFormation resourceFrank
Vignesh Rajagopalan
04/27/2021, 6:42 PMFrank
topic.snsSubscriptions
Frank
Vignesh Rajagopalan
04/27/2021, 6:53 PMFrank
Frank
maxReceivesPerSecond
to the first subscriber for the topic.
const topic = new sst.Topic(stack, "Topic", {
subscribers: ["test/lambda.handler"],
});
const subscription = topic.snsSubscriptions[0];
const cfnSub = subscription.node.defaultChild as sns.CfnSubscription;
cfnSub.deliveryPolicy = {
throttlePolicy: { "maxReceivesPerSecond": 10 }
};
Vignesh Rajagopalan
04/28/2021, 1:13 AM