Amazon ECS/Fargate

Amazon ECS/Fargate Task state.

class rhodes.states.services.ecs.AmazonEcs(title, *, Comment=None, Cluster=None, Group=None, LaunchType=None, NetworkConfiguration=None, Overrides=None, PlacementConstraints=None, PlacementStrategy=None, PlatformVersion=None, TaskDefinition=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

Start a new task using the specified task definition.

See service docs for more details.

Parameters:
  • Cluster – The short name or full Amazon Resource Name (ARN) of the cluster on which to run your task. If you do not specify a cluster, the default cluster is assumed.
  • Group – The name of the task group to associate with the task. The default value is the family name of the task definition (for example, family:my-family-name).
  • LaunchType – The launch type on which to run your task. For more information, see Amazon ECS Launch Types in the Amazon Elastic Container Service Developer Guide.
  • NetworkConfiguration – The network configuration for the task. This parameter is required for task definitions that use the awsvpc network mode to receive their own elastic network interface, and it is not supported for other network modes. For more information, see Task Networking in the Amazon Elastic Container Service Developer Guide.
  • Overrides – A list of container overrides in JSON format that specify the name of a container in the specified task definition and the overrides it should receive.
  • PlacementConstraints – An array of placement constraint objects to use for the task. You can specify up to 10 constraints per task (including constraints in the task definition and those specified at runtime).
  • PlacementStrategy – The placement strategy objects to use for the task. You can specify a maximum of five strategy rules per task.
  • PlatformVersion – The platform version the task should run. A platform version is only specified for tasks using the Fargate launch type. If one is not specified, the LATEST platform version is used by default. For more information, see AWS Fargate Platform Versions in the Amazon Elastic Container Service Developer Guide.
  • TaskDefinition – The family and revision (family:revision) or full ARN of the task definition to run. If a revision is not specified, the latest ACTIVE revision is used.
  • 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: ''>)
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.

to_dict() → Dict[KT, VT]

Serialize state as a dictionary.

Return type:Dict