Fred
Fred

Reputation: 830

Accessing input to step function to then use as message for SNS

I'm using the serverless framework to build a step function which receives input and then uses this input to send a message via SNS.

How do I pass the input to the message field?

Here is my definition and attempt:

stepFunctions:
  stateMachines:
    hellostepfunc1:
      name: testermachine
      definition:
        Comment: "test machine"
        StartAt: SNSState
        States:
          SNSState:
            Type: Task
            InputPath: $
            Resource: arn:aws:states:::sns:publish
            Parameters:
              TopicArn:
                Fn::GetAtt: [ MyTopic, TopicArn ]
              Message: {InputPath: $}
            End: true

Upvotes: 0

Views: 719

Answers (1)

fucalost
fucalost

Reputation: 522

You can perform a SNS publish operation within a Step Function. See AWS Docs - Connect to SNS from Step Functions

Upvotes: 1

Related Questions