Condition

class aws_cdk.aws_stepfunctions.Condition

Bases: object

A Condition for use in a Choice state branch.

ExampleMetadata:

infused

Example:

map = sfn.Map(self, "Map State",
    max_concurrency=1,
    items_path=sfn.JsonPath.string_at("$.inputForMap"),
    item_selector={
        "item": sfn.JsonPath.string_at("$.Map.Item.Value")
    },
    result_path="$.mapOutput"
)

# The Map iterator can contain a IChainable, which can be an individual or multiple steps chained together.
# Below example is with a Choice and Pass step
choice = sfn.Choice(self, "Choice")
condition1 = sfn.Condition.string_equals("$.item.status", "SUCCESS")
step1 = sfn.Pass(self, "Step1")
step2 = sfn.Pass(self, "Step2")
finish = sfn.Pass(self, "Finish")

definition = choice.when(condition1, step1).otherwise(step2).afterwards().next(finish)

map.item_processor(definition)

Methods

abstract render_condition()

Render Amazon States Language JSON for the condition.

Return type:

Any

Static Methods

classmethod and_(*conditions)

Combine two or more conditions with a logical AND.

Parameters:

conditions (Condition) –

Return type:

Condition

classmethod boolean_equals(variable, value)

Matches if a boolean field has the given value.

Parameters:
  • variable (str) –

  • value (bool) –

Return type:

Condition

classmethod boolean_equals_json_path(variable, value)

Matches if a boolean field equals to a value at a given mapping path.

Parameters:
  • variable (str) –

  • value (str) –

Return type:

Condition

classmethod is_boolean(variable)

Matches if variable is boolean.

Parameters:

variable (str) –

Return type:

Condition

classmethod is_not_boolean(variable)

Matches if variable is not boolean.

Parameters:

variable (str) –

Return type:

Condition

classmethod is_not_null(variable)

Matches if variable is not null.

Parameters:

variable (str) –

Return type:

Condition

classmethod is_not_numeric(variable)

Matches if variable is not numeric.

Parameters:

variable (str) –

Return type:

Condition

classmethod is_not_present(variable)

Matches if variable is not present.

Parameters:

variable (str) –

Return type:

Condition

classmethod is_not_string(variable)

Matches if variable is not a string.

Parameters:

variable (str) –

Return type:

Condition

classmethod is_not_timestamp(variable)

Matches if variable is not a timestamp.

Parameters:

variable (str) –

Return type:

Condition

classmethod is_null(variable)

Matches if variable is Null.

Parameters:

variable (str) –

Return type:

Condition

classmethod is_numeric(variable)

Matches if variable is numeric.

Parameters:

variable (str) –

Return type:

Condition

classmethod is_present(variable)

Matches if variable is present.

Parameters:

variable (str) –

Return type:

Condition

classmethod is_string(variable)

Matches if variable is a string.

Parameters:

variable (str) –

Return type:

Condition

classmethod is_timestamp(variable)

Matches if variable is a timestamp.

Parameters:

variable (str) –

Return type:

Condition

classmethod not_(condition)

Negate a condition.

Parameters:

condition (Condition) –

Return type:

Condition

classmethod number_equals(variable, value)

Matches if a numeric field has the given value.

Parameters:
  • variable (str) –

  • value (Union[int, float]) –

Return type:

Condition

classmethod number_equals_json_path(variable, value)

Matches if a numeric field has the value in a given mapping path.

Parameters:
  • variable (str) –

  • value (str) –

Return type:

Condition

classmethod number_greater_than(variable, value)

Matches if a numeric field is greater than the given value.

Parameters:
  • variable (str) –

  • value (Union[int, float]) –

Return type:

Condition

classmethod number_greater_than_equals(variable, value)

Matches if a numeric field is greater than or equal to the given value.

Parameters:
  • variable (str) –

  • value (Union[int, float]) –

Return type:

Condition

classmethod number_greater_than_equals_json_path(variable, value)

Matches if a numeric field is greater than or equal to the value at a given mapping path.

Parameters:
  • variable (str) –

  • value (str) –

Return type:

Condition

classmethod number_greater_than_json_path(variable, value)

Matches if a numeric field is greater than the value at a given mapping path.

Parameters:
  • variable (str) –

  • value (str) –

Return type:

Condition

classmethod number_less_than(variable, value)

Matches if a numeric field is less than the given value.

Parameters:
  • variable (str) –

  • value (Union[int, float]) –

Return type:

Condition

classmethod number_less_than_equals(variable, value)

Matches if a numeric field is less than or equal to the given value.

Parameters:
  • variable (str) –

  • value (Union[int, float]) –

Return type:

Condition

classmethod number_less_than_equals_json_path(variable, value)

Matches if a numeric field is less than or equal to the numeric value at given mapping path.

Parameters:
  • variable (str) –

  • value (str) –

Return type:

Condition

classmethod number_less_than_json_path(variable, value)

Matches if a numeric field is less than the value at the given mapping path.

Parameters:
  • variable (str) –

  • value (str) –

Return type:

Condition

classmethod or_(*conditions)

Combine two or more conditions with a logical OR.

Parameters:

conditions (Condition) –

Return type:

Condition

classmethod string_equals(variable, value)

Matches if a string field has the given value.

Parameters:
  • variable (str) –

  • value (str) –

Return type:

Condition

classmethod string_equals_json_path(variable, value)

Matches if a string field equals to a value at a given mapping path.

Parameters:
  • variable (str) –

  • value (str) –

Return type:

Condition

classmethod string_greater_than(variable, value)

Matches if a string field sorts after a given value.

Parameters:
  • variable (str) –

  • value (str) –

Return type:

Condition

classmethod string_greater_than_equals(variable, value)

Matches if a string field sorts after or equal to a given value.

Parameters:
  • variable (str) –

  • value (str) –

Return type:

Condition

classmethod string_greater_than_equals_json_path(variable, value)

Matches if a string field sorts after or equal to value at a given mapping path.

Parameters:
  • variable (str) –

  • value (str) –

Return type:

Condition

classmethod string_greater_than_json_path(variable, value)

Matches if a string field sorts after a value at a given mapping path.

Parameters:
  • variable (str) –

  • value (str) –

Return type:

Condition

classmethod string_less_than(variable, value)

Matches if a string field sorts before a given value.

Parameters:
  • variable (str) –

  • value (str) –

Return type:

Condition

classmethod string_less_than_equals(variable, value)

Matches if a string field sorts equal to or before a given value.

Parameters:
  • variable (str) –

  • value (str) –

Return type:

Condition

classmethod string_less_than_equals_json_path(variable, value)

Matches if a string field sorts equal to or before a given mapping.

Parameters:
  • variable (str) –

  • value (str) –

Return type:

Condition

classmethod string_less_than_json_path(variable, value)

Matches if a string field sorts before a given value at a particular mapping.

Parameters:
  • variable (str) –

  • value (str) –

Return type:

Condition

classmethod string_matches(variable, value)

Matches if a field matches a string pattern that can contain a wild card (*) e.g: log-.txt or *LATEST. No other characters other than “*” have any special meaning - * can be escaped: *.

Parameters:
  • variable (str) –

  • value (str) –

Return type:

Condition

classmethod timestamp_equals(variable, value)

Matches if a timestamp field is the same time as the given timestamp.

Parameters:
  • variable (str) –

  • value (str) –

Return type:

Condition

classmethod timestamp_equals_json_path(variable, value)

Matches if a timestamp field is the same time as the timestamp at a given mapping path.

Parameters:
  • variable (str) –

  • value (str) –

Return type:

Condition

classmethod timestamp_greater_than(variable, value)

Matches if a timestamp field is after the given timestamp.

Parameters:
  • variable (str) –

  • value (str) –

Return type:

Condition

classmethod timestamp_greater_than_equals(variable, value)

Matches if a timestamp field is after or equal to the given timestamp.

Parameters:
  • variable (str) –

  • value (str) –

Return type:

Condition

classmethod timestamp_greater_than_equals_json_path(variable, value)

Matches if a timestamp field is after or equal to the timestamp at a given mapping path.

Parameters:
  • variable (str) –

  • value (str) –

Return type:

Condition

classmethod timestamp_greater_than_json_path(variable, value)

Matches if a timestamp field is after the timestamp at a given mapping path.

Parameters:
  • variable (str) –

  • value (str) –

Return type:

Condition

classmethod timestamp_less_than(variable, value)

Matches if a timestamp field is before the given timestamp.

Parameters:
  • variable (str) –

  • value (str) –

Return type:

Condition

classmethod timestamp_less_than_equals(variable, value)

Matches if a timestamp field is before or equal to the given timestamp.

Parameters:
  • variable (str) –

  • value (str) –

Return type:

Condition

classmethod timestamp_less_than_equals_json_path(variable, value)

Matches if a timestamp field is before or equal to the timestamp at a given mapping path.

Parameters:
  • variable (str) –

  • value (str) –

Return type:

Condition

classmethod timestamp_less_than_json_path(variable, value)

Matches if a timestamp field is before the timestamp at a given mapping path.

Parameters:
  • variable (str) –

  • value (str) –

Return type:

Condition