I have SNS FIFO Topic, and using the step function SnsPublish to publish a message, but I am getting this error
Error
SNS.InvalidParameterException
Cause
Invalid parameter: The MessageGroupId parameter is required for FIFO topics (Service: AmazonSNS; Status Code: 400; Error Code: InvalidParameter; Request ID: 2dcc9124-1a2d-5527-93f1-c8a4f27ac92a; Proxy: null)
Could you please helpt how can i bound the MessageGroupId in the CDK ? when i add the Attribute messageGroupId CDK says Argument of type '{ topic: sns.Topic; message: sfn.TaskInput; messageGroupId: string; }' is not assignable to parameter of type 'SnsPublishProps'. I took my two days day and i did not find any solution until now
const newBookinewBookingRequestTopicngsQueue = new sqs.Queue(this, 'newBookingsQueueTestYAHYA', {
queueName: 'newBookingsQueueTest.fifo',
contentBasedDeduplication: true,
fifo: true
});
const sendNewBookingRequestSNSNotification = new tasks.SnsPublish(
this,
'Publish alert notification',
{
integrationPattern: sfn.IntegrationPattern.WAIT_FOR_TASK_TOKEN,
topic: newBookinewBookingRequestTopicngsQueue ,
message:sfn.TaskInput.fromObject({
snsMessage: sfn.JsonPath.entirePayload,
taskToken:sfn.JsonPath.taskToken
}),
/* MessageGroupId : "messageGroupId1",
MessageDeduplicationId: "messageDeduplicationId1" */
}
);
***'MessageGroupI' does not exist in type 'SnsPublishProps'
'MessageDeduplicationId' does not exist in type 'SnsPublishProps'***