From 7aa4174152bdff995067182794abf067421a824e Mon Sep 17 00:00:00 2001 From: Ryan Russell Date: Tue, 3 Oct 2023 13:47:34 -0700 Subject: [PATCH] Pin Terraform version - [CORE-1297] (#88) --- README.md | 8 +++++++- examples/executable-dependency/main.tf | 6 ++++-- examples/instance-type/main.tf | 8 +++++--- examples/join-path/main.tf | 6 ++++-- examples/list-remove/main.tf | 6 ++++-- examples/operating-system/main.tf | 6 ++++-- examples/pex/main.tf | 6 ++++-- examples/request-quota-increase/main.tf | 6 ++++-- examples/require-executable/main.tf | 6 ++++-- modules/executable-dependency/main.tf | 6 ++++-- modules/instance-type/main.tf | 7 +++++-- modules/join-path/main.tf | 6 ++++-- modules/list-remove/main.tf | 6 ++++-- modules/operating-system/main.tf | 6 ++++-- modules/prepare-pex-environment/dependencies.tf | 6 ++++-- modules/prepare-pex-environment/main.tf | 6 ++++-- modules/request-quota-increase/main.tf | 7 +++++-- modules/require-executable/main.tf | 6 ++++-- modules/run-pex-as-data-source/main.tf | 6 ++++-- modules/run-pex-as-resource/main.tf | 6 ++++-- 20 files changed, 86 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index 6762d2d..b24f62b 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,17 @@ [![Maintained by Gruntwork.io](https://img.shields.io/badge/maintained%20by-gruntwork.io-%235849a6.svg)](https://gruntwork.io/?ref=repo_package_terraform_utilities) [![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/gruntwork-io/terraform-aws-utilities.svg?label=latest)](https://github.com/gruntwork-io/terraform-aws-utilities/releases/latest) -![Terraform Version](https://img.shields.io/badge/tf-%3E%3D1.1.0-blue.svg) +![Terraform Version](https://img.shields.io/badge/tf-%3E%3D1.1.0%3C%2C%20%3C%3D1.5.7-blue.svg) # Terraform Utility Modules This repo contains miscellaneous utility and helper modules for use with Terraform. +## Information on HashiCorp BSL License Change + +Due to the HashiCorp BSL license change, we are restricting Terraform to the latest open source version (`1.5.7`). +Going forward we will be adding support for OpenTofu. To learn more, see the official [OpenTofu website](https://opentofu.org/) +and [project status](https://github.com/opentofu/opentofu/blob/main/WEEKLY_UPDATES.md). + ## What is in this repo This repo provides a Gruntwork IaC Package and has the following folder structure: diff --git a/examples/executable-dependency/main.tf b/examples/executable-dependency/main.tf index e77f80d..b2b8389 100644 --- a/examples/executable-dependency/main.tf +++ b/examples/executable-dependency/main.tf @@ -1,6 +1,8 @@ terraform { - # This module is now only being tested with Terraform 1.1.x. However, to make upgrading easier, we are setting 1.0.0 as the minimum version. - required_version = ">= 1.0.0" + # Due to the HashiCorp BSL License change, we are restricting the latest version of Terraform to 1.5.7. + # Going forward we will be adding support for OpenTofu. For additional information on OpenTofu please + # see the official OpenTofu website at https://opentofu.org/. + required_version = ">= 1.0.0, <= 1.5.7" } module "executable" { diff --git a/examples/instance-type/main.tf b/examples/instance-type/main.tf index dba871f..40c2b30 100644 --- a/examples/instance-type/main.tf +++ b/examples/instance-type/main.tf @@ -1,6 +1,8 @@ terraform { - # This module is now only being tested with Terraform 1.1.x. However, to make upgrading easier, we are setting 1.0.0 as the minimum version. - required_version = ">= 1.0.0" + # Due to the HashiCorp BSL License change, we are restricting the latest version of Terraform to 1.5.7. + # Going forward we will be adding support for OpenTofu. For additional information on OpenTofu please + # see the official OpenTofu website at https://opentofu.org/. + required_version = ">= 1.0.0, <= 1.5.7" } provider "aws" { @@ -55,6 +57,6 @@ data "aws_ami" "ubuntu" { filter { name = "name" - values = ["ubuntu/images/hvm-ssd/ubuntu-xenial-16.04-amd64-server-*"] + values = ["ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*"] } } \ No newline at end of file diff --git a/examples/join-path/main.tf b/examples/join-path/main.tf index 2aba838..f06400f 100644 --- a/examples/join-path/main.tf +++ b/examples/join-path/main.tf @@ -1,6 +1,8 @@ terraform { - # This module is now only being tested with Terraform 1.1.x. However, to make upgrading easier, we are setting 1.0.0 as the minimum version. - required_version = ">= 1.0.0" + # Due to the HashiCorp BSL License change, we are restricting the latest version of Terraform to 1.5.7. + # Going forward we will be adding support for OpenTofu. For additional information on OpenTofu please + # see the official OpenTofu website at https://opentofu.org/. + required_version = ">= 1.0.0, <= 1.5.7" } module "path" { diff --git a/examples/list-remove/main.tf b/examples/list-remove/main.tf index 2163833..f1bf2c6 100644 --- a/examples/list-remove/main.tf +++ b/examples/list-remove/main.tf @@ -1,6 +1,8 @@ terraform { - # This module is now only being tested with Terraform 1.1.x. However, to make upgrading easier, we are setting 1.0.0 as the minimum version. - required_version = ">= 1.0.0" + # Due to the HashiCorp BSL License change, we are restricting the latest version of Terraform to 1.5.7. + # Going forward we will be adding support for OpenTofu. For additional information on OpenTofu please + # see the official OpenTofu website at https://opentofu.org/. + required_version = ">= 1.0.0, <= 1.5.7" } module "list_remove" { diff --git a/examples/operating-system/main.tf b/examples/operating-system/main.tf index bfffaf3..44a85ba 100644 --- a/examples/operating-system/main.tf +++ b/examples/operating-system/main.tf @@ -1,6 +1,8 @@ terraform { - # This module is now only being tested with Terraform 1.1.x. However, to make upgrading easier, we are setting 1.0.0 as the minimum version. - required_version = ">= 1.0.0" + # Due to the HashiCorp BSL License change, we are restricting the latest version of Terraform to 1.5.7. + # Going forward we will be adding support for OpenTofu. For additional information on OpenTofu please + # see the official OpenTofu website at https://opentofu.org/. + required_version = ">= 1.0.0, <= 1.5.7" } module "os" { diff --git a/examples/pex/main.tf b/examples/pex/main.tf index 3224192..81e101d 100644 --- a/examples/pex/main.tf +++ b/examples/pex/main.tf @@ -5,8 +5,10 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ terraform { - # This module is now only being tested with Terraform 1.1.x. However, to make upgrading easier, we are setting 1.0.0 as the minimum version. - required_version = ">= 1.0.0" + # Due to the HashiCorp BSL License change, we are restricting the latest version of Terraform to 1.5.7. + # Going forward we will be adding support for OpenTofu. For additional information on OpenTofu please + # see the official OpenTofu website at https://opentofu.org/. + required_version = ">= 1.0.0, <= 1.5.7" } # Run the PEX binary as a local-exec provisioner on a null_resource. diff --git a/examples/request-quota-increase/main.tf b/examples/request-quota-increase/main.tf index ed1f63c..b7440b9 100644 --- a/examples/request-quota-increase/main.tf +++ b/examples/request-quota-increase/main.tf @@ -1,6 +1,8 @@ terraform { - # This module is now only being tested with Terraform 1.1.x. However, to make upgrading easier, we are setting 1.0.0 as the minimum version. - required_version = ">= 1.0.0" + # Due to the HashiCorp BSL License change, we are restricting the latest version of Terraform to 1.5.7. + # Going forward we will be adding support for OpenTofu. For additional information on OpenTofu please + # see the official OpenTofu website at https://opentofu.org/. + required_version = ">= 1.0.0, <= 1.5.7" } provider "aws" { diff --git a/examples/require-executable/main.tf b/examples/require-executable/main.tf index 8b04adc..64bb760 100644 --- a/examples/require-executable/main.tf +++ b/examples/require-executable/main.tf @@ -1,6 +1,8 @@ terraform { - # This module is now only being tested with Terraform 1.1.x. However, to make upgrading easier, we are setting 1.0.0 as the minimum version. - required_version = ">= 1.0.0" + # Due to the HashiCorp BSL License change, we are restricting the latest version of Terraform to 1.5.7. + # Going forward we will be adding support for OpenTofu. For additional information on OpenTofu please + # see the official OpenTofu website at https://opentofu.org/. + required_version = ">= 1.0.0, <= 1.5.7" } module "require_executables" { diff --git a/modules/executable-dependency/main.tf b/modules/executable-dependency/main.tf index 8b9141f..15e5856 100644 --- a/modules/executable-dependency/main.tf +++ b/modules/executable-dependency/main.tf @@ -1,6 +1,8 @@ terraform { - # This module is now only being tested with Terraform 1.1.x. However, to make upgrading easier, we are setting 1.0.0 as the minimum version. - required_version = ">= 1.0.0" + # Due to the HashiCorp BSL License change, we are restricting the latest version of Terraform to 1.5.7. + # Going forward we will be adding support for OpenTofu. For additional information on OpenTofu please + # see the official OpenTofu website at https://opentofu.org/. + required_version = ">= 1.0.0, <= 1.5.7" } data "external" "executable" { diff --git a/modules/instance-type/main.tf b/modules/instance-type/main.tf index 45040ac..e2cd2ae 100644 --- a/modules/instance-type/main.tf +++ b/modules/instance-type/main.tf @@ -1,6 +1,9 @@ terraform { - # This module is now only being tested with Terraform 1.1.x. However, to make upgrading easier, we are setting 1.0.0 as the minimum version. - required_version = ">= 1.0.0" + # Due to the HashiCorp BSL License change, we are restricting the latest version of Terraform to 1.5.7. + # Going forward we will be adding support for OpenTofu. For additional information on OpenTofu please + # see the official OpenTofu website at https://opentofu.org/. + required_version = ">= 1.0.0, <= 1.5.7" + required_providers { aws = { source = "hashicorp/aws" diff --git a/modules/join-path/main.tf b/modules/join-path/main.tf index 94a864a..17fbe07 100644 --- a/modules/join-path/main.tf +++ b/modules/join-path/main.tf @@ -1,6 +1,8 @@ terraform { - # This module is now only being tested with Terraform 1.1.x. However, to make upgrading easier, we are setting 1.0.0 as the minimum version. - required_version = ">= 1.0.0" + # Due to the HashiCorp BSL License change, we are restricting the latest version of Terraform to 1.5.7. + # Going forward we will be adding support for OpenTofu. For additional information on OpenTofu please + # see the official OpenTofu website at https://opentofu.org/. + required_version = ">= 1.0.0, <= 1.5.7" } module "os" { diff --git a/modules/list-remove/main.tf b/modules/list-remove/main.tf index aaa80ba..207e98f 100644 --- a/modules/list-remove/main.tf +++ b/modules/list-remove/main.tf @@ -1,6 +1,8 @@ terraform { - # This module is now only being tested with Terraform 1.1.x. However, to make upgrading easier, we are setting 1.0.0 as the minimum version. - required_version = ">= 1.0.0" + # Due to the HashiCorp BSL License change, we are restricting the latest version of Terraform to 1.5.7. + # Going forward we will be adding support for OpenTofu. For additional information on OpenTofu please + # see the official OpenTofu website at https://opentofu.org/. + required_version = ">= 1.0.0, <= 1.5.7" } # Remove the items in items_to_remove from original_list. This works because: diff --git a/modules/operating-system/main.tf b/modules/operating-system/main.tf index 4e3f48f..a550542 100644 --- a/modules/operating-system/main.tf +++ b/modules/operating-system/main.tf @@ -1,6 +1,8 @@ terraform { - # This module is now only being tested with Terraform 1.1.x. However, to make upgrading easier, we are setting 1.0.0 as the minimum version. - required_version = ">= 1.0.0" + # Due to the HashiCorp BSL License change, we are restricting the latest version of Terraform to 1.5.7. + # Going forward we will be adding support for OpenTofu. For additional information on OpenTofu please + # see the official OpenTofu website at https://opentofu.org/. + required_version = ">= 1.0.0, <= 1.5.7" } data "external" "os" { diff --git a/modules/prepare-pex-environment/dependencies.tf b/modules/prepare-pex-environment/dependencies.tf index 44ce45e..6001c03 100644 --- a/modules/prepare-pex-environment/dependencies.tf +++ b/modules/prepare-pex-environment/dependencies.tf @@ -4,8 +4,10 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ terraform { - # This module is now only being tested with Terraform 1.1.x. However, to make upgrading easier, we are setting 1.0.0 as the minimum version. - required_version = ">= 1.0.0" + # Due to the HashiCorp BSL License change, we are restricting the latest version of Terraform to 1.5.7. + # Going forward we will be adding support for OpenTofu. For additional information on OpenTofu please + # see the official OpenTofu website at https://opentofu.org/. + required_version = ">= 1.0.0, <= 1.5.7" } # Figure out the OS environment diff --git a/modules/prepare-pex-environment/main.tf b/modules/prepare-pex-environment/main.tf index fb4e632..f5bbe7e 100644 --- a/modules/prepare-pex-environment/main.tf +++ b/modules/prepare-pex-environment/main.tf @@ -7,8 +7,10 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ terraform { - # This module is now only being tested with Terraform 1.1.x. However, to make upgrading easier, we are setting 1.0.0 as the minimum version. - required_version = ">= 1.0.0" + # Due to the HashiCorp BSL License change, we are restricting the latest version of Terraform to 1.5.7. + # Going forward we will be adding support for OpenTofu. For additional information on OpenTofu please + # see the official OpenTofu website at https://opentofu.org/. + required_version = ">= 1.0.0, <= 1.5.7" } data "external" "determine_python_path" { diff --git a/modules/request-quota-increase/main.tf b/modules/request-quota-increase/main.tf index 468fd0c..d6ff803 100644 --- a/modules/request-quota-increase/main.tf +++ b/modules/request-quota-increase/main.tf @@ -1,6 +1,9 @@ terraform { - # This module is now only being tested with Terraform 1.1.x. However, to make upgrading easier, we are setting 1.0.0 as the minimum version. - required_version = ">= 1.0.0" + # Due to the HashiCorp BSL License change, we are restricting the latest version of Terraform to 1.5.7. + # Going forward we will be adding support for OpenTofu. For additional information on OpenTofu please + # see the official OpenTofu website at https://opentofu.org/. + required_version = ">= 1.0.0, <= 1.5.7" + required_providers { aws = { source = "hashicorp/aws" diff --git a/modules/require-executable/main.tf b/modules/require-executable/main.tf index 20f65a7..b0bdb92 100644 --- a/modules/require-executable/main.tf +++ b/modules/require-executable/main.tf @@ -1,6 +1,8 @@ terraform { - # This module is now only being tested with Terraform 1.1.x. However, to make upgrading easier, we are setting 1.0.0 as the minimum version. - required_version = ">= 1.0.0" + # Due to the HashiCorp BSL License change, we are restricting the latest version of Terraform to 1.5.7. + # Going forward we will be adding support for OpenTofu. For additional information on OpenTofu please + # see the official OpenTofu website at https://opentofu.org/. + required_version = ">= 1.0.0, <= 1.5.7" # Updating the Terraform external provider to 2.3.0 caused an undocumented breaking change (as evidenced by # issues like https://github.com/hashicorp/terraform-provider-external/issues/193). The solution is to pin diff --git a/modules/run-pex-as-data-source/main.tf b/modules/run-pex-as-data-source/main.tf index dbb894f..6b95853 100644 --- a/modules/run-pex-as-data-source/main.tf +++ b/modules/run-pex-as-data-source/main.tf @@ -6,8 +6,10 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ terraform { - # This module is now only being tested with Terraform 1.1.x. However, to make upgrading easier, we are setting 1.0.0 as the minimum version. - required_version = ">= 1.0.0" + # Due to the HashiCorp BSL License change, we are restricting the latest version of Terraform to 1.5.7. + # Going forward we will be adding support for OpenTofu. For additional information on OpenTofu please + # see the official OpenTofu website at https://opentofu.org/. + required_version = ">= 1.0.0, <= 1.5.7" } module "pex_env" { diff --git a/modules/run-pex-as-resource/main.tf b/modules/run-pex-as-resource/main.tf index 58c25e3..c3c0a7f 100644 --- a/modules/run-pex-as-resource/main.tf +++ b/modules/run-pex-as-resource/main.tf @@ -5,8 +5,10 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ terraform { - # This module is now only being tested with Terraform 1.1.x. However, to make upgrading easier, we are setting 1.0.0 as the minimum version. - required_version = ">= 1.0.0" + # Due to the HashiCorp BSL License change, we are restricting the latest version of Terraform to 1.5.7. + # Going forward we will be adding support for OpenTofu. For additional information on OpenTofu please + # see the official OpenTofu website at https://opentofu.org/. + required_version = ">= 1.0.0, <= 1.5.7" } module "pex_env" {