- When setting just maxAttempts for a step, the step attribute is not set when printing the document content.\
default_values = {
"max_attempts": 1
}
# Define your steps...
describe_snapshot = ssm.AwsApiStep(
self,
f"{id}describeSnapshot",
name="describeSnapshot",
description="Describe the provided snapshot id",
service="ec2",
pascal_case_api="DescribeSnapshots",
api_params={"SnapshotIds": ["{{ SnapshotId }}"]},
outputs=[
ssm.Output(
name="VolumeId",
output_type=ssm.DataTypeEnum.STRING,
selector="$.Snapshots[0].VolumeId",
),
ssm.Output(
name="State",
output_type=ssm.DataTypeEnum.STRING,
selector="$.Snapshots[0].State",
),
],
is_end=False,
**default_values
)
produces:
...
mainSteps:
- description: Describe the provided snapshot id
name: describeSnapshot
action: aws:executeAwsApi
inputs:
Service: ec2
Api: DescribeSnapshots
SnapshotIds:
- '{{ SnapshotId }}'
outputs:
- Name: VolumeId
Selector: $.Snapshots[0].VolumeId
Type: String
- Name: State
Selector: $.Snapshots[0].State
Type: String
....
- When setting timeoutInSeconds for a step, maxAttempts is set:
In Python:
default_values = {
"timeout_seconds": 100
}
# Define your steps...
describe_snapshot = ssm.AwsApiStep(
self,
f"{id}describeSnapshot",
name="describeSnapshot",
description="Describe the provided snapshot id",
service="ec2",
pascal_case_api="DescribeSnapshots",
api_params={"SnapshotIds": ["{{ SnapshotId }}"]},
outputs=[
ssm.Output(
name="VolumeId",
output_type=ssm.DataTypeEnum.STRING,
selector="$.Snapshots[0].VolumeId",
),
ssm.Output(
name="State",
output_type=ssm.DataTypeEnum.STRING,
selector="$.Snapshots[0].State",
),
],
is_end=False,
**default_values
)
produces:
...
mainSteps:
- description: Describe the provided snapshot id
name: describeSnapshot
action: aws:executeAwsApi
inputs:
Service: ec2
Api: DescribeSnapshots
SnapshotIds:
- '{{ SnapshotId }}'
outputs:
- Name: VolumeId
Selector: $.Snapshots[0].VolumeId
Type: String
- Name: State
Selector: $.Snapshots[0].State
Type: String
maxAttempts: 100
....
produces:
In Python:
produces: