1

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'***

Yahya
  • 51
  • 7
  • Will you please send your code as text instead of just a screenshot? –  Aug 02 '21 at 16:44
  • when i try here to add MessageGroupId or MessageDeduplicationId the i geot the message SnSpublish does not aupport it, but i need this two properties because the SNS send notifications to FIFO Topic, and in FIFO Topic is important to have the ID @Hcaertnit i will be thankfuly for your help – Yahya Aug 03 '21 at 08:32

0 Answers0