publish_state_machine_version
async
¶
publish_state_machine_version(
state_machine_arn: Arn,
*,
config_overrides: Optional[AsyncSFNClientConfig] = None,
revision_id: Optional[RevisionId] = None,
description: Optional[VersionDescription] = None,
) -> PublishStateMachineVersionOutput
Creates a version from the current revision of a state machine. Use versions to create immutable snapshots of your state machine. You can start executions from versions either directly or with an alias. To create an alias, use CreateStateMachineAlias.
You can publish up to 1000 versions for each state machine. You must manually delete unused versions using the DeleteStateMachineVersion API action.
PublishStateMachineVersion is an idempotent API. It doesn't create a duplicate state machine version if it already exists for the current revision. Step Functions bases PublishStateMachineVersion's idempotency check on the stateMachineArn, name, and revisionId parameters. Requests with the same parameters return a successful idempotent response. If you don't specify a revisionId, Step Functions checks for a previously published version of the state machine's current revision.
Related operations:
Parameters:
-
state_machine_arn(Arn) –The Amazon Resource Name (ARN) of the state machine.
-
revision_id(Optional[RevisionId], default:None) –Only publish the state machine version if the current state machine's revision ID matches the specified ID.
Use this option to avoid publishing a version if the state machine changed since you last updated it. If the specified revision ID doesn't match the state machine's current revision ID, the API returns
ConflictException.To specify an initial revision ID for a state machine with no revision ID assigned, specify the string
INITIALfor therevisionIdparameter. For example, you can specify arevisionIDofINITIALwhen you create a state machine using the CreateStateMachine API action. -
description(Optional[VersionDescription], default:None) –An optional description of the state machine version.
Raises:
-
ConflictException–Updating or deleting a resource can cause an inconsistent state. This error occurs when there're concurrent requests for DeleteStateMachineVersion, PublishStateMachineVersion, or UpdateStateMachine with the
publishparameter set totrue.HTTP Status Code: 409
-
InvalidArn–The provided Amazon Resource Name (ARN) is not valid.
-
ServiceQuotaExceededException–The request would cause a service quota to be exceeded.
HTTP Status Code: 402
-
StateMachineDeleting–The specified state machine is being deleted.
-
StateMachineDoesNotExist–The specified state machine does not exist.
-
ValidationException–The input does not satisfy the constraints specified by an Amazon Web Services service.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_sfn/_services/async_sfn.py
1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 | |