Skip to content

update_state_machine_alias

update_state_machine_alias(
    state_machine_alias_arn: Arn,
    *,
    config_overrides: Optional[SFNClientConfig] = None,
    description: Optional[AliasDescription] = None,
    routing_configuration: Optional[RoutingConfigurationList] = None,
) -> UpdateStateMachineAliasOutput

Updates the configuration of an existing state machine alias by modifying its description or routingConfiguration.

You must specify at least one of the description or routingConfiguration parameters to update a state machine alias.

UpdateStateMachineAlias is an idempotent API. Step Functions bases the idempotency check on the stateMachineAliasArn, description, and routingConfiguration parameters. Requests with the same parameters return an idempotent response.

This operation is eventually consistent. All StartExecution requests made within a few seconds use the latest alias configuration. Executions started immediately after calling UpdateStateMachineAlias may use the previous routing configuration.

Related operations:

Parameters:

  • state_machine_alias_arn (Arn) –

    The Amazon Resource Name (ARN) of the state machine alias.

  • description (Optional[AliasDescription], default: None ) –

    A description of the state machine alias.

  • routing_configuration (Optional[RoutingConfigurationList], default: None ) –

    The routing configuration of the state machine alias.

    An array of RoutingConfig objects that specifies up to two state machine versions that the alias starts executions for.

Raises:

Source code in docs_src/capo_sfn/_services/sfn.py
def update_state_machine_alias(
    self,
    state_machine_alias_arn: "capo_sfn.types.arn.Arn",
    *,
    config_overrides: Optional[SFNClientConfig] = None,
    description: Optional[
        "capo_sfn.types.alias_description.AliasDescription"
    ] = None,
    routing_configuration: Optional[
        "capo_sfn.types.routing_configuration_list.RoutingConfigurationList"
    ] = None,
) -> (
    "capo_sfn.types.update_state_machine_alias_output.UpdateStateMachineAliasOutput"
):
    """<p>Updates the configuration of an existing state machine <a href="https://docs.aws.amazon.com/step-functions/latest/dg/concepts-state-machine-alias.html">alias</a> by modifying its <code>description</code> or <code>routingConfiguration</code>.</p> <p>You must specify at least one of the <code>description</code> or <code>routingConfiguration</code> parameters to update a state machine alias.</p> <note> <p> <code>UpdateStateMachineAlias</code> is an idempotent API. Step Functions bases the idempotency check on the <code>stateMachineAliasArn</code>, <code>description</code>, and <code>routingConfiguration</code> parameters. Requests with the same parameters return an idempotent response.</p> </note> <note> <p>This operation is eventually consistent. All <a>StartExecution</a> requests made within a few seconds use the latest alias configuration. Executions started immediately after calling <code>UpdateStateMachineAlias</code> may use the previous routing configuration.</p> </note> <p> <b>Related operations:</b> </p> <ul> <li> <p> <a>CreateStateMachineAlias</a> </p> </li> <li> <p> <a>DescribeStateMachineAlias</a> </p> </li> <li> <p> <a>ListStateMachineAliases</a> </p> </li> <li> <p> <a>DeleteStateMachineAlias</a> </p> </li> </ul>

    Args:
        state_machine_alias_arn: <p>The Amazon Resource Name (ARN) of the state machine alias.</p>
        description: <p>A description of the state machine alias.</p>
        routing_configuration: <p>The routing configuration of the state machine alias.</p> <p>An array of <code>RoutingConfig</code> objects that specifies up to two state machine versions that the alias starts executions for.</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.resource_not_found.ResourceNotFound: <p>Could not find the referenced resource.</p>
        capo_sfn.errors.state_machine_deleting.StateMachineDeleting: <p>The specified state machine is being deleted.</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.update_state_machine_alias_input.UpdateStateMachineAliasInput]",
    ) -> OperationResponse[
        "capo_sfn.types.update_state_machine_alias_output.UpdateStateMachineAliasOutput"
    ]:
        import capo_sfn._operations.aws_step_functions.update_state_machine_alias

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

    def _redact_input(
        input_: "capo_sfn.types.update_state_machine_alias_input.UpdateStateMachineAliasInput",
    ) -> dict[str, Any]:
        import capo_sfn.types.update_state_machine_alias_input

        return capo_sfn.types.update_state_machine_alias_input.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("UpdateStateMachineAlias", redact_input=_redact_input),
    )
    input_: capo_sfn.types.update_state_machine_alias_input.UpdateStateMachineAliasInput = {
        "state_machine_alias_arn": state_machine_alias_arn
    }
    if description is not None:
        input_["description"] = description
    if routing_configuration is not None:
        input_["routing_configuration"] = routing_configuration

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