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 | aws.stepfunctions.state_machines |
Fields
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. |
For more information, see AWS::StepFunctions::StateMachine
.
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | RoleArn, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all state_machines
in a region.
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 aws.stepfunctions.state_machines
WHERE region = 'us-east-1';
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 aws.stepfunctions.state_machines
WHERE region = 'us-east-1' AND data__Identifier = '<Arn>';
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 aws.stepfunctions.state_machines (
RoleArn,
region
)
SELECT
'{{ RoleArn }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.stepfunctions.state_machines (
DefinitionString,
RoleArn,
StateMachineName,
StateMachineType,
LoggingConfiguration,
TracingConfiguration,
EncryptionConfiguration,
DefinitionS3Location,
DefinitionSubstitutions,
Definition,
Tags,
region
)
SELECT
'{{ DefinitionString }}',
'{{ RoleArn }}',
'{{ StateMachineName }}',
'{{ StateMachineType }}',
'{{ LoggingConfiguration }}',
'{{ TracingConfiguration }}',
'{{ EncryptionConfiguration }}',
'{{ DefinitionS3Location }}',
'{{ DefinitionSubstitutions }}',
'{{ Definition }}',
'{{ Tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: state_machine
props:
- name: DefinitionString
value: '{{ DefinitionString }}'
- name: RoleArn
value: '{{ RoleArn }}'
- name: StateMachineName
value: '{{ StateMachineName }}'
- name: StateMachineType
value: '{{ StateMachineType }}'
- name: LoggingConfiguration
value:
Level: '{{ Level }}'
IncludeExecutionData: '{{ IncludeExecutionData }}'
Destinations:
- CloudWatchLogsLogGroup:
LogGroupArn: '{{ LogGroupArn }}'
- name: TracingConfiguration
value:
Enabled: '{{ Enabled }}'
- name: EncryptionConfiguration
value:
KmsKeyId: '{{ KmsKeyId }}'
KmsDataKeyReusePeriodSeconds: '{{ KmsDataKeyReusePeriodSeconds }}'
Type: '{{ Type }}'
- name: DefinitionS3Location
value:
Bucket: '{{ Bucket }}'
Key: '{{ Key }}'
Version: '{{ Version }}'
- name: DefinitionSubstitutions
value: {}
- name: Definition
value: {}
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
DELETE
example
/*+ delete */
DELETE FROM aws.stepfunctions.state_machines
WHERE data__Identifier = '<Arn>'
AND region = 'us-east-1';
Permissions
To operate on the state_machines
resource, the following permissions are required:
Create
states:CreateStateMachine,
states:DescribeStateMachine,
states:TagResource,
iam:PassRole,
s3:GetObject,
kms:DescribeKey,
kms:GenerateDataKey
Read
states:DescribeStateMachine,
states:ListTagsForResource,
kms:Decrypt
Update
states:UpdateStateMachine,
states:TagResource,
states:UntagResource,
states:ListTagsForResource,
iam:PassRole,
kms:DescribeKey,
kms:GenerateDataKey
Delete
states:DeleteStateMachine,
states:DescribeStateMachine
List
states:ListStateMachines