Amazon SNS

Amazon SNS Task state.

class rhodes.states.services.sns.AmazonSns(title, *, Comment=None, Message=None, MessageAttributes=None, MessageStructure=None, Subject=None, PhoneNumber=None, TargetArn=None, TopicArn=None, Next=None, End=None, InputPath=JsonPath(path=Root()), OutputPath=JsonPath(path=Root()), ResultPath=JsonPath(path=Root()), Retry=None, Catch=None, TimeoutSeconds=None, HeartbeatSeconds=None, Pattern=<IntegrationPattern.REQUEST_RESPONSE: ''>)[source]

Bases: rhodes.states.State

Send a message to target using Amazon SNS. Target can be an Amazon SNS topic, a text message (SMS message) directly to a phone number, or a message to a mobile platform endpoint (when you specify the TargetArn).

See service docs for more details.

Exactly one of PhoneNumber, TargetArn, or TopicArn must be provided.

Parameters:
  • Message – The message you want to send.
  • MessageAttributes – Message attributes for Publish action.
  • MessageStructure – Set MessageStructure to json if you want to send a different message for each protocol.
  • Subject – Optional parameter to be used as the “Subject” line when the message is delivered to email endpoints. This field will also be included, if present, in the standard JSON messages delivered to other endpoints.
  • PhoneNumber – The phone number to which you want to deliver an SMS message. Use E.164 format.
  • TargetArn – If you don’t specify a value for the TargetArn parameter, you must specify a value for the PhoneNumber or TopicArn parameters.
  • TopicArn – The topic you want to publish to.
  • title (str) – Name of state in state machine
  • Comment (str) – Human-readable description of the state (default: '')
  • Next – The state that will follow this state
  • End (bool) – This state is a terminal state
  • InputPath (JsonPath) – The portion of the state input data to be used as input for the state (default: JsonPath(path=Root()))
  • OutputPath (JsonPath) – The portion of the state input data to be passed to the next state (default: JsonPath(path=Root()))
  • ResultPath (JsonPath) – Where in the state input data to place the results of this state (default: JsonPath(path=Root()))
  • Retry
  • Catch
  • TimeoutSeconds (int) – Maximum time that this state is allowed to run
  • HeartbeatSeconds (int) – Maximum time allowed between heartbeat responses from state
  • Pattern (IntegrationPattern) – Step Functions integration pattern (default: <IntegrationPattern.REQUEST_RESPONSE: ''>)
to_dict() → Dict[KT, VT]

Serialize state as a dictionary.

Return type:Dict
end()

Make this state a terminal state.

member_of = None
promote(path)

Add a Pass state after this state that promotes a path in the input to this state’s ResultPath.

Path must start with a path relative this state’s ResultPath as indicated by a @. prefix.

Parameters:path (Union[str, Enum, JSONPath, JsonPath]) – Path to promote
Return type:Pass
then(next_state)

Set the next state in this state machine.