diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index a6cd369..776bc24 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/antonbabenko/pre-commit-terraform
- rev: v1.96.1
+ rev: v1.99.4
hooks:
- id: terraform_fmt
- id: terraform_docs
diff --git a/README.md b/README.md
index 2fb0688..568355b 100644
--- a/README.md
+++ b/README.md
@@ -133,14 +133,14 @@ module "step_function" {
| Name | Version |
|------|---------|
-| [terraform](#requirement\_terraform) | >= 1.0 |
-| [aws](#requirement\_aws) | >= 5.61 |
+| [terraform](#requirement\_terraform) | >= 1.5.7 |
+| [aws](#requirement\_aws) | >= 6.0 |
## Providers
| Name | Version |
|------|---------|
-| [aws](#provider\_aws) | >= 5.61 |
+| [aws](#provider\_aws) | >= 6.0 |
## Modules
@@ -204,6 +204,7 @@ No modules.
| [policy\_path](#input\_policy\_path) | Path of IAM policies to use for Step Function | `string` | `null` | 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 |
+| [region](#input\_region) | Region where the resource(s) will be managed. Defaults to the region set in the provider configuration | `string` | `null` | 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 |
diff --git a/examples/complete/README.md b/examples/complete/README.md
index 017f398..f1cde7c 100644
--- a/examples/complete/README.md
+++ b/examples/complete/README.md
@@ -22,8 +22,8 @@ Note that this example may create resources which cost money. Run `terraform des
| Name | Version |
|------|---------|
-| [terraform](#requirement\_terraform) | >= 1.0 |
-| [aws](#requirement\_aws) | >= 5.61 |
+| [terraform](#requirement\_terraform) | >= 1.5.7 |
+| [aws](#requirement\_aws) | >= 6.0 |
| [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) | >= 5.61 |
+| [aws](#provider\_aws) | >= 6.0 |
| [null](#provider\_null) | >= 2 |
| [random](#provider\_random) | >= 2 |
@@ -41,7 +41,7 @@ Note that this example may create resources which cost money. Run `terraform des
|------|--------|---------|
| [disabled\_step\_function](#module\_disabled\_step\_function) | ../../ | n/a |
| [kms](#module\_kms) | terraform-aws-modules/kms/aws | ~> 1.0 |
-| [lambda\_function](#module\_lambda\_function) | terraform-aws-modules/lambda/aws | ~> 2.0 |
+| [lambda\_function](#module\_lambda\_function) | terraform-aws-modules/lambda/aws | ~> 8.0 |
| [step\_function](#module\_step\_function) | ../../ | n/a |
| [step\_function\_with\_existing\_log\_group](#module\_step\_function\_with\_existing\_log\_group) | ../../ | n/a |
diff --git a/examples/complete/main.tf b/examples/complete/main.tf
index b371b3d..65059e1 100644
--- a/examples/complete/main.tf
+++ b/examples/complete/main.tf
@@ -241,12 +241,12 @@ resource "null_resource" "download_package" {
module "lambda_function" {
source = "terraform-aws-modules/lambda/aws"
- version = "~> 2.0"
+ version = "~> 8.0"
function_name = "${random_pet.this.id}-lambda"
description = "My awesome lambda function"
handler = "index.lambda_handler"
- runtime = "python3.8"
+ runtime = "python3.12"
publish = true
diff --git a/examples/complete/versions.tf b/examples/complete/versions.tf
index 799ca4b..f3c7855 100644
--- a/examples/complete/versions.tf
+++ b/examples/complete/versions.tf
@@ -1,10 +1,10 @@
terraform {
- required_version = ">= 1.0"
+ required_version = ">= 1.5.7"
required_providers {
aws = {
source = "hashicorp/aws"
- version = ">= 5.61"
+ version = ">= 6.0"
}
random = {
source = "hashicorp/random"
diff --git a/main.tf b/main.tf
index 48ac874..f20f9d9 100644
--- a/main.tf
+++ b/main.tf
@@ -15,6 +15,8 @@ locals {
resource "aws_sfn_state_machine" "this" {
count = var.create ? 1 : 0
+ region = var.region
+
name = var.name
role_arn = var.use_existing_role ? var.role_arn : aws_iam_role.this[0].arn
@@ -323,6 +325,8 @@ data "aws_cloudwatch_log_group" "sfn" {
resource "aws_cloudwatch_log_group" "sfn" {
count = var.create && local.enable_logging && !var.use_existing_cloudwatch_log_group ? 1 : 0
+ region = var.region
+
name = coalesce(var.cloudwatch_log_group_name, "/aws/vendedlogs/states/${var.name}")
retention_in_days = var.cloudwatch_log_group_retention_in_days
kms_key_id = var.cloudwatch_log_group_kms_key_id
diff --git a/variables.tf b/variables.tf
index fa5fc61..479a842 100644
--- a/variables.tf
+++ b/variables.tf
@@ -26,6 +26,11 @@ variable "use_existing_cloudwatch_log_group" {
# Step Function
################
+variable "region" {
+ description = "Region where the resource(s) will be managed. Defaults to the region set in the provider configuration"
+ type = string
+ default = null
+}
variable "name" {
description = "The name of the Step Function"
type = string
diff --git a/versions.tf b/versions.tf
index 97e87e8..db13b0a 100644
--- a/versions.tf
+++ b/versions.tf
@@ -1,10 +1,10 @@
terraform {
- required_version = ">= 1.0"
+ required_version = ">= 1.5.7"
required_providers {
aws = {
source = "hashicorp/aws"
- version = ">= 5.61"
+ version = ">= 6.0"
}
}
}