update_state_machine
async
¶
update_state_machine(
state_machine_arn: Arn,
*,
config_overrides: Optional[AsyncSFNClientConfig] = None,
definition: Optional[Definition] = None,
role_arn: Optional[Arn] = None,
logging_configuration: Optional[LoggingConfiguration] = None,
tracing_configuration: Optional[TracingConfiguration] = None,
publish: Optional[Publish] = None,
version_description: Optional[VersionDescription] = None,
encryption_configuration: Optional[EncryptionConfiguration] = None,
) -> UpdateStateMachineOutput
Updates an existing state machine by modifying its definition, roleArn, loggingConfiguration, or EncryptionConfiguration. Running executions will continue to use the previous definition and roleArn. You must include at least one of definition or roleArn or you will receive a MissingRequiredParameter error.
A qualified state machine ARN refers to a Distributed Map state defined within a state machine. For example, the qualified state machine ARN arn:partition:states:region:account-id:stateMachine:stateMachineName/mapStateLabel refers to a Distributed Map state with a label mapStateLabel in the state machine named stateMachineName.
A qualified state machine ARN can either refer to a Distributed Map state defined within a state machine, a version ARN, or an alias ARN.
The following are some examples of qualified and unqualified state machine ARNs:
-
The following qualified state machine ARN refers to a Distributed Map state with a label
mapStateLabelin a state machine namedmyStateMachine.arn:partition:states:region:account-id:stateMachine:myStateMachine/mapStateLabelIf you provide a qualified state machine ARN that refers to a Distributed Map state, the request fails with
ValidationException. -
The following qualified state machine ARN refers to an alias named
PROD.arn::states: : :stateMachine: If you provide a qualified state machine ARN that refers to a version ARN or an alias ARN, the request starts execution for that version or alias.
-
The following unqualified state machine ARN refers to a state machine named
myStateMachine.arn::states: : :stateMachine:
After you update your state machine, you can set the publish parameter to true in the same action to publish a new version. This way, you can opt-in to strict versioning of your state machine.
Step Functions assigns monotonically increasing integers for state machine versions, starting at version number 1.
All StartExecution calls within a few seconds use the updated definition and roleArn. Executions started immediately after you call UpdateStateMachine may use the previous state machine definition and roleArn.
Parameters:
-
state_machine_arn(Arn) –The Amazon Resource Name (ARN) of the state machine.
-
definition(Optional[Definition], default:None) –The Amazon States Language definition of the state machine. See Amazon States Language.
-
role_arn(Optional[Arn], default:None) –The Amazon Resource Name (ARN) of the IAM role of the state machine.
-
logging_configuration(Optional[LoggingConfiguration], default:None) –Use the
LoggingConfigurationdata type to set CloudWatch Logs options. -
tracing_configuration(Optional[TracingConfiguration], default:None) –Selects whether X-Ray tracing is enabled.
-
publish(Optional[Publish], default:None) –Specifies whether the state machine version is published. The default is
false. To publish a version after updating the state machine, setpublishtotrue. -
version_description(Optional[VersionDescription], default:None) –An optional description of the state machine version to publish.
You can only specify the
versionDescriptionparameter if you've setpublishtotrue. -
encryption_configuration(Optional[EncryptionConfiguration], default:None) –Settings to configure server-side encryption.
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.
-
InvalidDefinition–The provided Amazon States Language definition is not valid.
-
InvalidEncryptionConfiguration–Received when
encryptionConfigurationis specified but various conditions exist which make the configuration invalid. For example, iftypeis set toCUSTOMER_MANAGED_KMS_KEY, butkmsKeyIdis null, orkmsDataKeyReusePeriodSecondsis not between 60 and 900, or the KMS key is not symmetric or inactive. -
InvalidLoggingConfiguration–Configuration is not valid.
-
InvalidTracingConfiguration–Your
tracingConfigurationkey does not match, orenabledhas not been set totrueorfalse. -
KmsAccessDeniedException–Either your KMS key policy or API caller does not have the required permissions.
-
KmsThrottlingException–Received when KMS returns
ThrottlingExceptionfor a KMS call that Step Functions makes on behalf of the caller. -
MissingRequiredParameter–Request is missing a required parameter. This error occurs if both
definitionandroleArnare not specified. -
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
2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 | |