class Condition
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.StepFunctions.Condition |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsstepfunctions#Condition |
Java | software.amazon.awscdk.services.stepfunctions.Condition |
Python | aws_cdk.aws_stepfunctions.Condition |
TypeScript (source) | aws-cdk-lib » aws_stepfunctions » Condition |
A Condition for use in a Choice state branch.
Example
const map = new sfn.Map(this, 'Map State', {
maxConcurrency: 1,
itemsPath: sfn.JsonPath.stringAt('$.inputForMap'),
itemSelector: {
item: sfn.JsonPath.stringAt('$$.Map.Item.Value'),
},
resultPath: '$.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
const choice = new sfn.Choice(this, 'Choice');
const condition1 = sfn.Condition.stringEquals('$.item.status', 'SUCCESS');
const step1 = new sfn.Pass(this, 'Step1');
const step2 = new sfn.Pass(this, 'Step2');
const finish = new sfn.Pass(this, 'Finish');
const definition = choice
.when(condition1, step1)
.otherwise(step2)
.afterwards()
.next(finish);
map.itemProcessor(definition);
Initializer
new Condition()
Methods
Name | Description |
---|---|
render | Render Amazon States Language JSON for the condition. |
static and(...conditions) | Combine two or more conditions with a logical AND. |
static boolean | Matches if a boolean field has the given value. |
static boolean | Matches if a boolean field equals to a value at a given mapping path. |
static is | Matches if variable is boolean. |
static is | Matches if variable is not boolean. |
static is | Matches if variable is not null. |
static is | Matches if variable is not numeric. |
static is | Matches if variable is not present. |
static is | Matches if variable is not a string. |
static is | Matches if variable is not a timestamp. |
static is | Matches if variable is Null. |
static is | Matches if variable is numeric. |
static is | Matches if variable is present. |
static is | Matches if variable is a string. |
static is | Matches if variable is a timestamp. |
static not(condition) | Negate a condition. |
static number | Matches if a numeric field has the given value. |
static number | Matches if a numeric field has the value in a given mapping path. |
static number | Matches if a numeric field is greater than the given value. |
static number | Matches if a numeric field is greater than or equal to the given value. |
static number | Matches if a numeric field is greater than or equal to the value at a given mapping path. |
static number | Matches if a numeric field is greater than the value at a given mapping path. |
static number | Matches if a numeric field is less than the given value. |
static number | Matches if a numeric field is less than or equal to the given value. |
static number | Matches if a numeric field is less than or equal to the numeric value at given mapping path. |
static number | Matches if a numeric field is less than the value at the given mapping path. |
static or(...conditions) | Combine two or more conditions with a logical OR. |
static string | Matches if a string field has the given value. |
static string | Matches if a string field equals to a value at a given mapping path. |
static string | Matches if a string field sorts after a given value. |
static string | Matches if a string field sorts after or equal to a given value. |
static string | Matches if a string field sorts after or equal to value at a given mapping path. |
static string | Matches if a string field sorts after a value at a given mapping path. |
static string | Matches if a string field sorts before a given value. |
static string | Matches if a string field sorts equal to or before a given value. |
static string | Matches if a string field sorts equal to or before a given mapping. |
static string | Matches if a string field sorts before a given value at a particular mapping. |
static string | 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: \. |
static timestamp | Matches if a timestamp field is the same time as the given timestamp. |
static timestamp | Matches if a timestamp field is the same time as the timestamp at a given mapping path. |
static timestamp | Matches if a timestamp field is after the given timestamp. |
static timestamp | Matches if a timestamp field is after or equal to the given timestamp. |
static timestamp | Matches if a timestamp field is after or equal to the timestamp at a given mapping path. |
static timestamp | Matches if a timestamp field is after the timestamp at a given mapping path. |
static timestamp | Matches if a timestamp field is before the given timestamp. |
static timestamp | Matches if a timestamp field is before or equal to the given timestamp. |
static timestamp | Matches if a timestamp field is before or equal to the timestamp at a given mapping path. |
static timestamp | Matches if a timestamp field is before the timestamp at a given mapping path. |
Condition()
renderpublic renderCondition(): any
Returns
any
Render Amazon States Language JSON for the condition.
static and(...conditions)
public static and(...conditions: Condition[]): Condition
Parameters
- conditions
Condition
Returns
Combine two or more conditions with a logical AND.
Equals(variable, value)
static booleanpublic static booleanEquals(variable: string, value: boolean): Condition
Parameters
- variable
string
- value
boolean
Returns
Matches if a boolean field has the given value.
EqualsJsonPath(variable, value)
static booleanpublic static booleanEqualsJsonPath(variable: string, value: string): Condition
Parameters
- variable
string
- value
string
Returns
Matches if a boolean field equals to a value at a given mapping path.
Boolean(variable)
static ispublic static isBoolean(variable: string): Condition
Parameters
- variable
string
Returns
Matches if variable is boolean.
NotBoolean(variable)
static ispublic static isNotBoolean(variable: string): Condition
Parameters
- variable
string
Returns
Matches if variable is not boolean.
NotNull(variable)
static ispublic static isNotNull(variable: string): Condition
Parameters
- variable
string
Returns
Matches if variable is not null.
NotNumeric(variable)
static ispublic static isNotNumeric(variable: string): Condition
Parameters
- variable
string
Returns
Matches if variable is not numeric.
NotPresent(variable)
static ispublic static isNotPresent(variable: string): Condition
Parameters
- variable
string
Returns
Matches if variable is not present.
NotString(variable)
static ispublic static isNotString(variable: string): Condition
Parameters
- variable
string
Returns
Matches if variable is not a string.
NotTimestamp(variable)
static ispublic static isNotTimestamp(variable: string): Condition
Parameters
- variable
string
Returns
Matches if variable is not a timestamp.
Null(variable)
static ispublic static isNull(variable: string): Condition
Parameters
- variable
string
Returns
Matches if variable is Null.
Numeric(variable)
static ispublic static isNumeric(variable: string): Condition
Parameters
- variable
string
Returns
Matches if variable is numeric.
Present(variable)
static ispublic static isPresent(variable: string): Condition
Parameters
- variable
string
Returns
Matches if variable is present.
String(variable)
static ispublic static isString(variable: string): Condition
Parameters
- variable
string
Returns
Matches if variable is a string.
Timestamp(variable)
static ispublic static isTimestamp(variable: string): Condition
Parameters
- variable
string
Returns
Matches if variable is a timestamp.
static not(condition)
public static not(condition: Condition): Condition
Parameters
- condition
Condition
Returns
Negate a condition.
Equals(variable, value)
static numberpublic static numberEquals(variable: string, value: number): Condition
Parameters
- variable
string
- value
number
Returns
Matches if a numeric field has the given value.
EqualsJsonPath(variable, value)
static numberpublic static numberEqualsJsonPath(variable: string, value: string): Condition
Parameters
- variable
string
- value
string
Returns
Matches if a numeric field has the value in a given mapping path.
GreaterThan(variable, value)
static numberpublic static numberGreaterThan(variable: string, value: number): Condition
Parameters
- variable
string
- value
number
Returns
Matches if a numeric field is greater than the given value.
GreaterThanEquals(variable, value)
static numberpublic static numberGreaterThanEquals(variable: string, value: number): Condition
Parameters
- variable
string
- value
number
Returns
Matches if a numeric field is greater than or equal to the given value.
GreaterThanEqualsJsonPath(variable, value)
static numberpublic static numberGreaterThanEqualsJsonPath(variable: string, value: string): Condition
Parameters
- variable
string
- value
string
Returns
Matches if a numeric field is greater than or equal to the value at a given mapping path.
GreaterThanJsonPath(variable, value)
static numberpublic static numberGreaterThanJsonPath(variable: string, value: string): Condition
Parameters
- variable
string
- value
string
Returns
Matches if a numeric field is greater than the value at a given mapping path.
LessThan(variable, value)
static numberpublic static numberLessThan(variable: string, value: number): Condition
Parameters
- variable
string
- value
number
Returns
Matches if a numeric field is less than the given value.
LessThanEquals(variable, value)
static numberpublic static numberLessThanEquals(variable: string, value: number): Condition
Parameters
- variable
string
- value
number
Returns
Matches if a numeric field is less than or equal to the given value.
LessThanEqualsJsonPath(variable, value)
static numberpublic static numberLessThanEqualsJsonPath(variable: string, value: string): Condition
Parameters
- variable
string
- value
string
Returns
Matches if a numeric field is less than or equal to the numeric value at given mapping path.
LessThanJsonPath(variable, value)
static numberpublic static numberLessThanJsonPath(variable: string, value: string): Condition
Parameters
- variable
string
- value
string
Returns
Matches if a numeric field is less than the value at the given mapping path.
static or(...conditions)
public static or(...conditions: Condition[]): Condition
Parameters
- conditions
Condition
Returns
Combine two or more conditions with a logical OR.
Equals(variable, value)
static stringpublic static stringEquals(variable: string, value: string): Condition
Parameters
- variable
string
- value
string
Returns
Matches if a string field has the given value.
EqualsJsonPath(variable, value)
static stringpublic static stringEqualsJsonPath(variable: string, value: string): Condition
Parameters
- variable
string
- value
string
Returns
Matches if a string field equals to a value at a given mapping path.
GreaterThan(variable, value)
static stringpublic static stringGreaterThan(variable: string, value: string): Condition
Parameters
- variable
string
- value
string
Returns
Matches if a string field sorts after a given value.
GreaterThanEquals(variable, value)
static stringpublic static stringGreaterThanEquals(variable: string, value: string): Condition
Parameters
- variable
string
- value
string
Returns
Matches if a string field sorts after or equal to a given value.
GreaterThanEqualsJsonPath(variable, value)
static stringpublic static stringGreaterThanEqualsJsonPath(variable: string, value: string): Condition
Parameters
- variable
string
- value
string
Returns
Matches if a string field sorts after or equal to value at a given mapping path.
GreaterThanJsonPath(variable, value)
static stringpublic static stringGreaterThanJsonPath(variable: string, value: string): Condition
Parameters
- variable
string
- value
string
Returns
Matches if a string field sorts after a value at a given mapping path.
LessThan(variable, value)
static stringpublic static stringLessThan(variable: string, value: string): Condition
Parameters
- variable
string
- value
string
Returns
Matches if a string field sorts before a given value.
LessThanEquals(variable, value)
static stringpublic static stringLessThanEquals(variable: string, value: string): Condition
Parameters
- variable
string
- value
string
Returns
Matches if a string field sorts equal to or before a given value.
LessThanEqualsJsonPath(variable, value)
static stringpublic static stringLessThanEqualsJsonPath(variable: string, value: string): Condition
Parameters
- variable
string
- value
string
Returns
Matches if a string field sorts equal to or before a given mapping.
LessThanJsonPath(variable, value)
static stringpublic static stringLessThanJsonPath(variable: string, value: string): Condition
Parameters
- variable
string
- value
string
Returns
Matches if a string field sorts before a given value at a particular mapping.
Matches(variable, value)
static stringpublic static stringMatches(variable: string, value: string): Condition
Parameters
- variable
string
- value
string
Returns
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: \.
Equals(variable, value)
static timestamppublic static timestampEquals(variable: string, value: string): Condition
Parameters
- variable
string
- value
string
Returns
Matches if a timestamp field is the same time as the given timestamp.
EqualsJsonPath(variable, value)
static timestamppublic static timestampEqualsJsonPath(variable: string, value: string): Condition
Parameters
- variable
string
- value
string
Returns
Matches if a timestamp field is the same time as the timestamp at a given mapping path.
GreaterThan(variable, value)
static timestamppublic static timestampGreaterThan(variable: string, value: string): Condition
Parameters
- variable
string
- value
string
Returns
Matches if a timestamp field is after the given timestamp.
GreaterThanEquals(variable, value)
static timestamppublic static timestampGreaterThanEquals(variable: string, value: string): Condition
Parameters
- variable
string
- value
string
Returns
Matches if a timestamp field is after or equal to the given timestamp.
GreaterThanEqualsJsonPath(variable, value)
static timestamppublic static timestampGreaterThanEqualsJsonPath(variable: string, value: string): Condition
Parameters
- variable
string
- value
string
Returns
Matches if a timestamp field is after or equal to the timestamp at a given mapping path.
GreaterThanJsonPath(variable, value)
static timestamppublic static timestampGreaterThanJsonPath(variable: string, value: string): Condition
Parameters
- variable
string
- value
string
Returns
Matches if a timestamp field is after the timestamp at a given mapping path.
LessThan(variable, value)
static timestamppublic static timestampLessThan(variable: string, value: string): Condition
Parameters
- variable
string
- value
string
Returns
Matches if a timestamp field is before the given timestamp.
LessThanEquals(variable, value)
static timestamppublic static timestampLessThanEquals(variable: string, value: string): Condition
Parameters
- variable
string
- value
string
Returns
Matches if a timestamp field is before or equal to the given timestamp.
LessThanEqualsJsonPath(variable, value)
static timestamppublic static timestampLessThanEqualsJsonPath(variable: string, value: string): Condition
Parameters
- variable
string
- value
string
Returns
Matches if a timestamp field is before or equal to the timestamp at a given mapping path.
LessThanJsonPath(variable, value)
static timestamppublic static timestampLessThanJsonPath(variable: string, value: string): Condition
Parameters
- variable
string
- value
string
Returns
Matches if a timestamp field is before the timestamp at a given mapping path.