Skip to content

delete_state_machine_version

delete_state_machine_version(
    state_machine_version_arn: LongArn,
    *,
    config_overrides: Optional[SFNClientConfig] = None,
) -> DeleteStateMachineVersionOutput

Deletes a state machine version. After you delete a version, you can't call StartExecution using that version's ARN or use the version with a state machine alias.

Deleting a state machine version won't terminate its in-progress executions.

You can't delete a state machine version currently referenced by one or more aliases. Before you delete a version, you must either delete the aliases or update them to point to another state machine version.

Related operations:

Parameters:

  • state_machine_version_arn (LongArn) –

    The Amazon Resource Name (ARN) of the state machine version to delete.

Raises:

Source code in docs_src/capo_sfn/_services/sfn.py
def delete_state_machine_version(
    self,
    state_machine_version_arn: "capo_sfn.types.long_arn.LongArn",
    *,
    config_overrides: Optional[SFNClientConfig] = None,
) -> "capo_sfn.types.delete_state_machine_version_output.DeleteStateMachineVersionOutput":
    """<p>Deletes a state machine <a href="https://docs.aws.amazon.com/step-functions/latest/dg/concepts-state-machine-version.html">version</a>. After you delete a version, you can't call <a>StartExecution</a> using that version's ARN or use the version with a state machine <a href="https://docs.aws.amazon.com/step-functions/latest/dg/concepts-state-machine-alias.html">alias</a>.</p> <note> <p>Deleting a state machine version won't terminate its in-progress executions.</p> </note> <note> <p>You can't delete a state machine version currently referenced by one or more aliases. Before you delete a version, you must either delete the aliases or update them to point to another state machine version.</p> </note> <p> <b>Related operations:</b> </p> <ul> <li> <p> <a>PublishStateMachineVersion</a> </p> </li> <li> <p> <a>ListStateMachineVersions</a> </p> </li> </ul>

    Args:
        state_machine_version_arn: <p>The Amazon Resource Name (ARN) of the state machine version to delete.</p>

    Raises:
        capo_sfn.errors.conflict_exception.ConflictException: <p>Updating or deleting a resource can cause an inconsistent state. This error occurs when there're concurrent requests for <a>DeleteStateMachineVersion</a>, <a>PublishStateMachineVersion</a>, or <a>UpdateStateMachine</a> with the <code>publish</code> parameter set to <code>true</code>.</p> <p>HTTP Status Code: 409</p>
        capo_sfn.errors.invalid_arn.InvalidArn: <p>The provided Amazon Resource Name (ARN) is not valid.</p>
        capo_sfn.errors.validation_exception.ValidationException: <p>The input does not satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_sfn.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_sfn.types.delete_state_machine_version_input.DeleteStateMachineVersionInput]",
    ) -> OperationResponse[
        "capo_sfn.types.delete_state_machine_version_output.DeleteStateMachineVersionOutput"
    ]:
        import capo_sfn._operations.aws_step_functions.delete_state_machine_version

        output, http_response = (
            capo_sfn._operations.aws_step_functions.delete_state_machine_version.delete_state_machine_version(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteStateMachineVersion")
    )
    input_: capo_sfn.types.delete_state_machine_version_input.DeleteStateMachineVersionInput = {
        "state_machine_version_arn": state_machine_version_arn
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output