state_machines
Creates, updates, deletes or gets a state_machine resource or lists state_machines in a region
Overview
| Name | state_machines |
| Type | Resource |
| Description | Resource schema for StateMachine |
| Id | awscc.stepfunctions.state_machines |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
arn | string | |
name | string | |
definition_string | string | |
role_arn | string | |
state_machine_name | string | |
state_machine_type | string | |
state_machine_revision_id | string | |
logging_configuration | object | |
tracing_configuration | object | |
encryption_configuration | object | |
definition_s3_location | object | |
definition_substitutions | object | |
definition | object | |
tags | array | |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
arn | string | |
region | string | AWS region. |
For more information, see AWS::StepFunctions::StateMachine.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | state_machines | INSERT | RoleArn, region |
delete_resource | state_machines | DELETE | Identifier, region |
update_resource | state_machines | UPDATE | Identifier, PatchDocument, region |
list_resources | state_machines_list_only | SELECT | region |
get_resource | state_machines | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual state_machine.
SELECT
region,
arn,
name,
definition_string,
role_arn,
state_machine_name,
state_machine_type,
state_machine_revision_id,
logging_configuration,
tracing_configuration,
encryption_configuration,
definition_s3_location,
definition_substitutions,
definition,
tags
FROM awscc.stepfunctions.state_machines
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}';
Lists all state_machines in a region.
SELECT
region,
arn
FROM awscc.stepfunctions.state_machines_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new state_machine resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.stepfunctions.state_machines (
RoleArn,
region
)
SELECT
'{{ role_arn }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.stepfunctions.state_machines (
DefinitionString,
RoleArn,
StateMachineName,
StateMachineType,
LoggingConfiguration,
TracingConfiguration,
EncryptionConfiguration,
DefinitionS3Location,
DefinitionSubstitutions,
Definition,
Tags,
region
)
SELECT
'{{ definition_string }}',
'{{ role_arn }}',
'{{ state_machine_name }}',
'{{ state_machine_type }}',
'{{ logging_configuration }}',
'{{ tracing_configuration }}',
'{{ encryption_configuration }}',
'{{ definition_s3_location }}',
'{{ definition_substitutions }}',
'{{ definition }}',
'{{ tags }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: state_machine
props:
- name: definition_string
value: '{{ definition_string }}'
- name: role_arn
value: '{{ role_arn }}'
- name: state_machine_name
value: '{{ state_machine_name }}'
- name: state_machine_type
value: '{{ state_machine_type }}'
- name: logging_configuration
value:
level: '{{ level }}'
include_execution_data: '{{ include_execution_data }}'
destinations:
- cloud_watch_logs_log_group:
log_group_arn: '{{ log_group_arn }}'
- name: tracing_configuration
value:
enabled: '{{ enabled }}'
- name: encryption_configuration
value:
kms_key_id: '{{ kms_key_id }}'
kms_data_key_reuse_period_seconds: '{{ kms_data_key_reuse_period_seconds }}'
type: '{{ type }}'
- name: definition_s3_location
value:
bucket: '{{ bucket }}'
key: '{{ key }}'
version: '{{ version }}'
- name: definition_substitutions
value: {}
- name: definition
value: {}
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
UPDATE example
Use the following StackQL query and manifest file to update a state_machine resource, using stack-deploy.
/*+ update */
UPDATE awscc.stepfunctions.state_machines
SET PatchDocument = string('{{ {
"DefinitionString": definition_string,
"RoleArn": role_arn,
"LoggingConfiguration": logging_configuration,
"TracingConfiguration": tracing_configuration,
"EncryptionConfiguration": encryption_configuration,
"DefinitionS3Location": definition_s3_location,
"DefinitionSubstitutions": definition_substitutions,
"Definition": definition,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.stepfunctions.state_machines
WHERE
Identifier = '{{ arn }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
Permissions
To operate on the state_machines resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
states:CreateStateMachine,
states:DescribeStateMachine,
states:TagResource,
iam:PassRole,
s3:GetObject,
kms:DescribeKey,
kms:GenerateDataKey
states:DescribeStateMachine,
states:ListTagsForResource,
kms:Decrypt
states:UpdateStateMachine,
states:TagResource,
states:UntagResource,
states:ListTagsForResource,
iam:PassRole,
kms:DescribeKey,
kms:GenerateDataKey
states:DeleteStateMachine,
states:DescribeStateMachine
states:ListStateMachines