Provides information about a state machine's definition, its IAM role Amazon Resource Name (ARN), and configuration.
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 mapStateLabel in a state machine named myStateMachine.
arn:partition:states:region:account-id:stateMachine:myStateMachine/mapStateLabel
If 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:
This API action returns the details for a state machine version if the stateMachineArn you specify is a state machine version ARN.
This operation is eventually consistent. The results are best effort and may not reflect very recent updates and changes.
Parameters:
-
state_machine_arn
(Arn)
–
The Amazon Resource Name (ARN) of the state machine for which you want the information.
If you specify a state machine version ARN, this API returns details about that version. The version ARN is a combination of state machine ARN and the version number separated by a colon (:). For example, stateMachineARN:1.
-
included_data
(Optional[IncludedData], default:
None
)
–
If your state machine definition is encrypted with a KMS key, callers must have kms:Decrypt permission to decrypt the definition. Alternatively, you can call the API with includedData = METADATA_ONLY to get a successful response without the encrypted definition.
When calling a labelled ARN for an encrypted state machine, the includedData = METADATA_ONLY parameter will not apply because Step Functions needs to decrypt the entire state machine definition to get the Distributed Map state’s definition. In this case, the API caller needs to have kms:Decrypt permission.
Raises:
Source code in docs_src/capo_sfn/_services/async_sfn.py
| async def describe_state_machine(
self,
state_machine_arn: "capo_sfn.types.arn.Arn",
*,
config_overrides: Optional[AsyncSFNClientConfig] = None,
included_data: Optional["capo_sfn.types.included_data.IncludedData"] = None,
) -> "capo_sfn.types.describe_state_machine_output.DescribeStateMachineOutput":
"""<p>Provides information about a state machine's definition, its IAM role Amazon Resource Name (ARN), and configuration.</p> <p>A qualified state machine ARN can either refer to a <i>Distributed Map state</i> defined within a state machine, a version ARN, or an alias ARN.</p> <p>The following are some examples of qualified and unqualified state machine ARNs:</p> <ul> <li> <p>The following qualified state machine ARN refers to a <i>Distributed Map state</i> with a label <code>mapStateLabel</code> in a state machine named <code>myStateMachine</code>.</p> <p> <code>arn:partition:states:region:account-id:stateMachine:myStateMachine/mapStateLabel</code> </p> <note> <p>If you provide a qualified state machine ARN that refers to a <i>Distributed Map state</i>, the request fails with <code>ValidationException</code>.</p> </note> </li> <li> <p>The following qualified state machine ARN refers to an alias named <code>PROD</code>.</p> <p> <code>arn:<partition>:states:<region>:<account-id>:stateMachine:<myStateMachine:PROD></code> </p> <note> <p>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.</p> </note> </li> <li> <p>The following unqualified state machine ARN refers to a state machine named <code>myStateMachine</code>.</p> <p> <code>arn:<partition>:states:<region>:<account-id>:stateMachine:<myStateMachine></code> </p> </li> </ul> <p>This API action returns the details for a state machine version if the <code>stateMachineArn</code> you specify is a state machine version ARN.</p> <note> <p>This operation is eventually consistent. The results are best effort and may not reflect very recent updates and changes.</p> </note>
Args:
state_machine_arn: <p>The Amazon Resource Name (ARN) of the state machine for which you want the information.</p> <p>If you specify a state machine version ARN, this API returns details about that version. The version ARN is a combination of state machine ARN and the version number separated by a colon (:). For example, <code>stateMachineARN:1</code>.</p>
included_data: <p>If your state machine definition is encrypted with a KMS key, callers must have <code>kms:Decrypt</code> permission to decrypt the definition. Alternatively, you can call the API with <code>includedData = METADATA_ONLY</code> to get a successful response without the encrypted definition.</p> <note> <p> When calling a labelled ARN for an encrypted state machine, the <code>includedData = METADATA_ONLY</code> parameter will not apply because Step Functions needs to decrypt the entire state machine definition to get the Distributed Map state’s definition. In this case, the API caller needs to have <code>kms:Decrypt</code> permission. </p> </note>
Raises:
capo_sfn.errors.invalid_arn.InvalidArn: <p>The provided Amazon Resource Name (ARN) is not valid.</p>
capo_sfn.errors.kms_access_denied_exception.KmsAccessDeniedException: <p>Either your KMS key policy or API caller does not have the required permissions.</p>
capo_sfn.errors.kms_invalid_state_exception.KmsInvalidStateException: <p>The KMS key is not in valid state, for example: Disabled or Deleted.</p>
capo_sfn.errors.kms_throttling_exception.KmsThrottlingException: <p>Received when KMS returns <code>ThrottlingException</code> for a KMS call that Step Functions makes on behalf of the caller.</p>
capo_sfn.errors.state_machine_does_not_exist.StateMachineDoesNotExist: <p>The specified state machine does not exist.</p>
capo_sfn.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_sfn.types.describe_state_machine_input.DescribeStateMachineInput]",
) -> AsyncOperationResponse[
"capo_sfn.types.describe_state_machine_output.DescribeStateMachineOutput"
]:
import capo_sfn._operations.aws_step_functions.describe_state_machine
(
output,
http_response,
) = await capo_sfn._operations.aws_step_functions.describe_state_machine.async_describe_state_machine(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
def _redact_output(
output: "capo_sfn.types.describe_state_machine_output.DescribeStateMachineOutput",
) -> dict[str, Any]:
import capo_sfn.types.describe_state_machine_output
return capo_sfn.types.describe_state_machine_output.redact_sensitive(output)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging("DescribeStateMachine", redact_output=_redact_output),
)
input_: capo_sfn.types.describe_state_machine_input.DescribeStateMachineInput = {
"state_machine_arn": state_machine_arn
}
if included_data is not None:
input_["included_data"] = included_data
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|