Skip to content

Commit 864d46a

Browse files
authored
feat: Add support for Step Function type - STANDARD (default) or EXPRESS (#2)
1 parent 8e21eca commit 864d46a

File tree

8 files changed

+29
-14
lines changed

8 files changed

+29
-14
lines changed

.gitignore

+4-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
.terraform
2-
*.tfstate.backup
3-
*.tfstate
4-
*.tfvars
5-
*.tfplan
2+
terraform.tfstate
3+
*.tfstate*
4+
terraform.tfvars
65

7-
builds/
8-
9-
__pycache__/
6+
.terraform.lock.hcl

README.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ EOF
5050
}
5151
}
5252
53+
type = "STANDARD"
54+
5355
tags = {
5456
Module = "my"
5557
}
@@ -127,13 +129,13 @@ module "step_function" {
127129
| Name | Version |
128130
|------|---------|
129131
| terraform | >= 0.12.6 |
130-
| aws | >= 2.67 |
132+
| aws | >= 3.27 |
131133

132134
## Providers
133135

134136
| Name | Version |
135137
|------|---------|
136-
| aws | >= 2.67 |
138+
| aws | >= 3.27 |
137139

138140
## Inputs
139141

@@ -167,6 +169,7 @@ module "step_function" {
167169
| service\_integrations | Map of AWS service integrations to allow in IAM role policy | `any` | `{}` | no |
168170
| tags | Maps of tags to assign to the Step Function | `map(string)` | `{}` | no |
169171
| trusted\_entities | Step Function additional trusted entities for assuming roles (trust relationship) | `list(string)` | `[]` | no |
172+
| type | Determines whether a Standard or Express state machine is created. The default is STANDARD. Valid Values: STANDARD \| EXPRESS | `string` | `"STANDARD"` | no |
170173
| use\_existing\_role | Whether to use an existing IAM role for this Step Function | `bool` | `false` | no |
171174

172175
## Outputs

examples/complete/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ Note that this example may create resources which cost money. Run `terraform des
2323
| Name | Version |
2424
|------|---------|
2525
| terraform | >= 0.12.6 |
26-
| aws | >= 2.67 |
26+
| aws | >= 3.27 |
2727
| random | >= 2 |
2828

2929
## Providers
3030

3131
| Name | Version |
3232
|------|---------|
33-
| aws | >= 2.67 |
33+
| aws | >= 3.27 |
3434
| random | >= 2 |
3535

3636
## Inputs

examples/complete/main.tf

+2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ module "step_function" {
3636

3737
name = random_pet.this.id
3838

39+
type = "express"
40+
3941
definition = local.definition_template
4042

4143
service_integrations = {

examples/complete/versions.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ terraform {
22
required_version = ">= 0.12.6"
33

44
required_providers {
5-
aws = ">= 2.67"
5+
aws = ">= 3.27"
66
random = ">= 2"
77
}
88
}

main.tf

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
locals {
2-
create_role = var.create && var.create_role && ! var.use_existing_role
2+
create_role = var.create && var.create_role && !var.use_existing_role
33
aws_region = local.create_role && var.aws_region_assume_role == "" ? data.aws_region.current[0].name : var.aws_region_assume_role
44

55
role_name = local.create_role ? coalesce(var.role_name, var.name) : null
@@ -13,6 +13,8 @@ resource "aws_sfn_state_machine" "this" {
1313
role_arn = var.use_existing_role ? var.role_arn : aws_iam_role.this[0].arn
1414
definition = var.definition
1515

16+
type = upper(var.type)
17+
1618
tags = merge({ Name = var.name }, var.tags)
1719
}
1820

variables.tf

+11
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,17 @@ variable "tags" {
4444
default = {}
4545
}
4646

47+
variable "type" {
48+
description = "Determines whether a Standard or Express state machine is created. The default is STANDARD. Valid Values: STANDARD | EXPRESS"
49+
type = string
50+
default = "STANDARD"
51+
52+
validation {
53+
condition = contains(["STANDARD", "EXPRESS"], upper(var.type))
54+
error_message = "Step Function type must be one of the following (STANDARD | EXPRESS)."
55+
}
56+
}
57+
4758
###########
4859
# IAM Role
4960
###########

versions.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ terraform {
22
required_version = ">= 0.12.6"
33

44
required_providers {
5-
aws = ">= 2.67"
5+
aws = ">= 3.27"
66
}
77
}

0 commit comments

Comments
 (0)