Skip to content

[aws-stepfunctions-tasks] How to set MessageGroupId for SNS Publish Task? #20280

Answered by srachit
srachit asked this question in Q&A
Discussion options

You must be logged in to vote

I was able to solve this issue by extending tasks.SNSPublish:

export interface SnsPublishProps extends tasks.SnsPublishProps {
    readonly messageGroupId: string;
}

export class FifoSnsPublish extends tasks.SnsPublish {
  private readonly messageGroupId: string;

    constructor(scope: Construct, id: string, props: SnsPublishProps) {
        super(scope, id, props);
        this.messageGroupId = props.messageGroupId;
    }

    protected _renderTask(): any {
        const result = super._renderTask()
        result.Parameters.MessageGroupId = this.messageGroupId;
        return result;
    }
}

Would be helpful if this was natively supported

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@jeffgardnerdev
Comment options

Answer selected by indrora
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants