From 28a77d261ef46f5a5ff133c6ab68d851312c0666 Mon Sep 17 00:00:00 2001 From: Melissa Greenbaum <69476188+magreenbaum@users.noreply.github.com> Date: Sun, 1 Oct 2023 07:30:19 -0400 Subject: [PATCH 1/2] feat!: Added publish functionality and bump AWS provider version to v5 (#57) Co-authored-by: magreenbaum --- README.md | 6 ++++-- examples/complete/README.md | 5 +++-- examples/complete/main.tf | 2 +- examples/complete/outputs.tf | 5 +++++ examples/complete/versions.tf | 15 ++++++++++++--- main.tf | 1 + outputs.tf | 5 +++++ variables.tf | 6 ++++++ versions.tf | 5 ++++- 9 files changed, 41 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 32263da..a49f7f1 100644 --- a/README.md +++ b/README.md @@ -134,13 +134,13 @@ module "step_function" { | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 4.66 | +| [aws](#requirement\_aws) | >= 5.6 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 4.66 | +| [aws](#provider\_aws) | >= 5.6 | ## Modules @@ -201,6 +201,7 @@ No modules. | [policy\_json](#input\_policy\_json) | An additional policy document as JSON to attach to IAM role | `string` | `null` | no | | [policy\_jsons](#input\_policy\_jsons) | List of additional policy documents as JSON to attach to IAM role | `list(string)` | `[]` | no | | [policy\_statements](#input\_policy\_statements) | Map of dynamic policy statements to attach to IAM role | `any` | `{}` | no | +| [publish](#input\_publish) | Determines whether to set a version of the state machine when it is created. | `bool` | `false` | no | | [role\_arn](#input\_role\_arn) | The Amazon Resource Name (ARN) of the IAM role to use for this Step Function | `string` | `""` | no | | [role\_description](#input\_role\_description) | Description of IAM role to use for Step Function | `string` | `null` | no | | [role\_force\_detach\_policies](#input\_role\_force\_detach\_policies) | Specifies to force detaching any policies the IAM role has before destroying it. | `bool` | `true` | no | @@ -228,6 +229,7 @@ No modules. | [state\_machine\_creation\_date](#output\_state\_machine\_creation\_date) | The date the Step Function was created | | [state\_machine\_id](#output\_state\_machine\_id) | The ARN of the Step Function | | [state\_machine\_status](#output\_state\_machine\_status) | The current status of the Step Function | +| [state\_machine\_version\_arn](#output\_state\_machine\_version\_arn) | The ARN of state machine version | ## Authors diff --git a/examples/complete/README.md b/examples/complete/README.md index 8a1bf9c..a68da59 100644 --- a/examples/complete/README.md +++ b/examples/complete/README.md @@ -23,7 +23,7 @@ Note that this example may create resources which cost money. Run `terraform des | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 4.66 | +| [aws](#requirement\_aws) | >= 5.6 | | [null](#requirement\_null) | >= 2 | | [random](#requirement\_random) | >= 2 | @@ -31,7 +31,7 @@ Note that this example may create resources which cost money. Run `terraform des | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 4.66 | +| [aws](#provider\_aws) | >= 5.6 | | [null](#provider\_null) | >= 2 | | [random](#provider\_random) | >= 2 | @@ -69,4 +69,5 @@ No inputs. | [state\_machine\_creation\_date](#output\_state\_machine\_creation\_date) | The date the State Machine was created | | [state\_machine\_id](#output\_state\_machine\_id) | The ARN of the State Machine | | [state\_machine\_status](#output\_state\_machine\_status) | The current status of the State Machine | +| [state\_machine\_version\_arn](#output\_state\_machine\_version\_arn) | The ARN of state machine version | diff --git a/examples/complete/main.tf b/examples/complete/main.tf index 88acfd4..8de90ad 100644 --- a/examples/complete/main.tf +++ b/examples/complete/main.tf @@ -2,7 +2,6 @@ provider "aws" { region = "eu-west-1" # Make it faster by skipping something - skip_get_ec2_platforms = true skip_metadata_api_check = true skip_region_validation = true skip_credentials_validation = true @@ -38,6 +37,7 @@ module "step_function" { type = "express" definition = local.definition_template + publish = true logging_configuration = { include_execution_data = true diff --git a/examples/complete/outputs.tf b/examples/complete/outputs.tf index f72a42d..6d7699d 100644 --- a/examples/complete/outputs.tf +++ b/examples/complete/outputs.tf @@ -19,6 +19,11 @@ output "state_machine_status" { value = module.step_function.state_machine_status } +output "state_machine_version_arn" { + description = "The ARN of state machine version" + value = module.step_function.state_machine_version_arn +} + # IAM Role output "role_arn" { description = "The ARN of the IAM role created for the State Machine" diff --git a/examples/complete/versions.tf b/examples/complete/versions.tf index 7031f10..41e9efc 100644 --- a/examples/complete/versions.tf +++ b/examples/complete/versions.tf @@ -2,8 +2,17 @@ terraform { required_version = ">= 1.0" required_providers { - aws = ">= 4.66" - random = ">= 2" - null = ">= 2" + aws = { + source = "hashicorp/aws" + version = ">= 5.6" + } + random = { + source = "hashicorp/random" + version = ">= 2" + } + null = { + source = "hashicorp/null" + version = ">= 2" + } } } diff --git a/main.tf b/main.tf index 851cf02..37a2171 100644 --- a/main.tf +++ b/main.tf @@ -19,6 +19,7 @@ resource "aws_sfn_state_machine" "this" { role_arn = var.use_existing_role ? var.role_arn : aws_iam_role.this[0].arn definition = var.definition + publish = var.publish dynamic "logging_configuration" { for_each = local.enable_logging ? [true] : [] diff --git a/outputs.tf b/outputs.tf index 30da4b9..9eafb99 100644 --- a/outputs.tf +++ b/outputs.tf @@ -19,6 +19,11 @@ output "state_machine_status" { value = try(aws_sfn_state_machine.this[0].status, "") } +output "state_machine_version_arn" { + description = "The ARN of state machine version" + value = try(aws_sfn_state_machine.this[0].state_machine_version_arn, "") +} + # IAM Role output "role_arn" { description = "The ARN of the IAM role created for the Step Function" diff --git a/variables.tf b/variables.tf index 06ce0cd..445c8ee 100644 --- a/variables.tf +++ b/variables.tf @@ -67,6 +67,12 @@ variable "sfn_state_machine_timeouts" { default = {} } +variable "publish" { + description = "Determines whether to set a version of the state machine when it is created." + type = bool + default = false +} + ################# # CloudWatch Logs ################# diff --git a/versions.tf b/versions.tf index 52505a3..7b7071c 100644 --- a/versions.tf +++ b/versions.tf @@ -2,6 +2,9 @@ terraform { required_version = ">= 1.0" required_providers { - aws = ">= 4.66" + aws = { + source = "hashicorp/aws" + version = ">= 5.6" + } } } From fd635965d5032dbe7fd7f818afd0d247a31de770 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Sun, 1 Oct 2023 11:30:49 +0000 Subject: [PATCH 2/2] chore(release): version 4.0.0 [skip ci] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## [4.0.0](https://github.com/terraform-aws-modules/terraform-aws-step-functions/compare/v3.1.0...v4.0.0) (2023-10-01) ### ⚠ BREAKING CHANGES * Added publish functionality and bump AWS provider version to v5 (#57) ### Features * Added publish functionality and bump AWS provider version to v5 ([#57](https://github.com/terraform-aws-modules/terraform-aws-step-functions/issues/57)) ([28a77d2](https://github.com/terraform-aws-modules/terraform-aws-step-functions/commit/28a77d261ef46f5a5ff133c6ab68d851312c0666)) --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a38415..6defbb0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,17 @@ All notable changes to this project will be documented in this file. +## [4.0.0](https://github.com/terraform-aws-modules/terraform-aws-step-functions/compare/v3.1.0...v4.0.0) (2023-10-01) + + +### ⚠ BREAKING CHANGES + +* Added publish functionality and bump AWS provider version to v5 (#57) + +### Features + +* Added publish functionality and bump AWS provider version to v5 ([#57](https://github.com/terraform-aws-modules/terraform-aws-step-functions/issues/57)) ([28a77d2](https://github.com/terraform-aws-modules/terraform-aws-step-functions/commit/28a77d261ef46f5a5ff133c6ab68d851312c0666)) + ## [3.1.0](https://github.com/terraform-aws-modules/terraform-aws-step-functions/compare/v3.0.0...v3.1.0) (2023-05-17)