terraform-aws-step-functions
module "state_machine" {
source = " git::ssh://git@github.com/oozou/terraform-aws-step-functions.git?ref=<version>"
prefix = " oozou"
environment = " dev"
name = " schedule"
# IAM
is_create_role = true
exists_role_arn = " " # Ignore if is_create_role is `true`
additional_role_policy_arn = {}
# State machine settings
type = " STANDARD" # Or EXPRESS is allowed
# # Recommendation use this; copy definition and insert here or using templatefile function
# # https://ap-southeast-1.console.aws.amazon.com/states/home?region=ap-southeast-1#/homepage
definition = << EOF
{
"Comment": "A description of my state machine",
"StartAt": "LambdaInvoke",
"States": {
"LambdaInvoke": {
"Type": "Task",
"Resource": "arn:aws:states:::lambda:invoke",
"OutputPath": "$.Payload",
"Parameters": {
"Payload.$": "$",
"FunctionName": "${ module . lambda . function_arn } "
},
"Next": "CheckStatusCode"
},
"CheckStatusCode": {
"Type": "Choice",
"InputPath": "$",
"Choices": [
{
"Variable": "$.statusCode",
"NumericEquals": 500,
"Next": "Wait"
}
],
"Default": "SuccessState"
},
"Wait": {
"Type": "Wait",
"OutputPath": "$.event",
"Seconds": 10,
"Next": "LambdaInvoke"
},
"SuccessState": {
"Type": "Succeed"
}
}
}
EOF
# Auto generate policy related to this resource
service_integrations = {
lambda = {
lambda = [" <arn_of_lambda_function>*" ]
}
}
# Logging
is_create_cloudwatch_log_group = true
log_include_execution_data = null
log_level = " ALL"
cloudwatch_log_retention_in_days = 30
tags = { " Workspace" = " xxx-yyy-zzz" }
}
No modules.
Name
Description
Type
Default
Required
additional_role_policy_arn
Map of policies ARNs to attach to the lambda
map(string)
{}
no
attach_policies_for_integrations
Whether to attach AWS Service policies to IAM role
bool
true
no
cloudwatch_log_retention_in_days
Retention day for cloudwatch log group
number
90
no
definition
The Amazon States Language definition of the Step Function
string
n/a
yes
environment
Environment Variable used as a prefix
string
n/a
yes
exists_role_arn
The exist role arn for step functions
string
""
no
is_create_cloudwatch_log_group
Whether to create cloudwatch log group or not
bool
true
no
is_create_role
Whether to create step function roles or not
bool
true
no
kms_key_id
The ARN for the KMS encryption key. Leave this default if account_mode is hub. If account_mode is spoke, please provide centrailize kms key arn (hub).
string
""
no
log_include_execution_data
(Optional) Determines whether execution data is included in your log. When set to false, data is excluded.
bool
null
no
log_level
(Optional) Defines which category of execution history events are logged. Valid values: ALL, ERROR, FATAL, OFF
string
"OFF"
no
name
Name of the ECS cluster to create
string
n/a
yes
prefix
The prefix name of customer to be displayed in AWS console and resource
string
n/a
yes
service_integrations
Map of AWS service integrations to allow in IAM role policy
any
{}
no
tags
Custom tags which can be passed on to the AWS resources. They should be key value pairs having distinct keys
map(any)
{}
no
trusted_entities
Step Function additional trusted entities for assuming roles (trust relationship)
list(string)
[]
no
type
Determines whether a Standard or Express state machine is created. The default is STANDARD. Valid Values: STANDARD | EXPRESS
string
"STANDARD"
no