Skip to content

Commit 02cd5b9

Browse files
committed
chore(examples): bump Terraform required_version to >= 1.0, refresh provider pins
Updated all examples/ to target modern Terraform/OpenTofu (>= 1.0) and current AWS/Azure/GCP provider versions. Removed stale 2020-era comments referencing 0.12.x/0.13.x pins. Linear: OSS-3399
1 parent d982515 commit 02cd5b9

53 files changed

Lines changed: 450 additions & 515 deletions

File tree

  • examples
    • azure
      • terraform-azure-aci-example
      • terraform-azure-acr-example
      • terraform-azure-actiongroup-example
      • terraform-azure-aks-example
      • terraform-azure-availabilityset-example
      • terraform-azure-container-apps-example
      • terraform-azure-cosmosdb-example
      • terraform-azure-datafactory-example
      • terraform-azure-disk-example
      • terraform-azure-example
      • terraform-azure-frontdoor-example
      • terraform-azure-functionapp-example
      • terraform-azure-keyvault-example
      • terraform-azure-loadbalancer-example
      • terraform-azure-loganalytics-example
      • terraform-azure-monitor-example
      • terraform-azure-mysqldb-example
      • terraform-azure-network-example
      • terraform-azure-nsg-example
      • terraform-azure-postgresql-example
      • terraform-azure-recoveryservices-example
      • terraform-azure-resourcegroup-example
      • terraform-azure-servicebus-example
      • terraform-azure-sqldb-example
      • terraform-azure-sqlmanagedinstance-example
      • terraform-azure-storage-example
      • terraform-azure-synapse-example
      • terraform-azure-vm-example
    • terraform-asg-scp-example
    • terraform-aws-dynamodb-example
    • terraform-aws-ec2-windows-example
    • terraform-aws-ecs-example
    • terraform-aws-example
    • terraform-aws-hello-world-example
    • terraform-aws-lambda-example
    • terraform-aws-network-example
    • terraform-aws-rds-example
    • terraform-aws-s3-example
    • terraform-aws-ssm-example
    • terraform-backend-example
    • terraform-basic-example
    • terraform-gcp-example
    • terraform-gcp-hello-world-example
    • terraform-gcp-ig-example
    • terraform-gcp-pubsub-example
    • terraform-hello-world-example
    • terraform-http-example
    • terraform-packer-example
    • terraform-redeploy-example
    • terraform-remote-exec-example
    • terraform-ssh-certificate-example
    • terraform-ssh-example
    • terraform-ssh-password-example

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

examples/azure/terraform-azure-aci-example/main.tf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@
99
# ------------------------------------------------------------------------------
1010

1111
terraform {
12+
required_version = ">= 1.0"
13+
1214
required_providers {
1315
azurerm = {
14-
version = "~>2.29.0"
1516
source = "hashicorp/azurerm"
17+
version = "~> 3.0"
1618
}
1719
}
1820
}
@@ -39,7 +41,7 @@ resource "azurerm_container_group" "aci" {
3941
location = azurerm_resource_group.rg.location
4042
resource_group_name = azurerm_resource_group.rg.name
4143

42-
ip_address_type = "public"
44+
ip_address_type = "Public"
4345
dns_name_label = "aci${var.postfix}"
4446
os_type = "Linux"
4547

examples/azure/terraform-azure-acr-example/main.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@
99
# ------------------------------------------------------------------------------
1010

1111
terraform {
12+
required_version = ">= 1.0"
13+
1214
required_providers {
1315
azurerm = {
14-
version = "~>2.29.0"
1516
source = "hashicorp/azurerm"
17+
version = "~> 4.0"
1618
}
1719
}
1820
}

examples/azure/terraform-azure-actiongroup-example/main.tf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@
77
# CONFIGURE OUR AZURE CONNECTION
88
# ---------------------------------------------------------------------------------------------------------------------
99

10+
terraform {
11+
required_version = ">= 1.0"
12+
13+
required_providers {
14+
azurerm = {
15+
source = "hashicorp/azurerm"
16+
version = "~> 4.0"
17+
}
18+
}
19+
}
20+
1021
provider "azurerm" {
1122
features {}
1223
}

examples/azure/terraform-azure-aks-example/main.tf

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,14 @@
77
# ---------------------------------------------------------------------------------------------------------------------
88

99
terraform {
10-
# This module is now only being tested with Terraform 0.13.x. However, to make upgrading easier, we are setting
11-
# 0.12.26 as the minimum version, as that version added support for required_providers with source URLs, making it
12-
# forwards compatible with 0.13.x code.
13-
required_version = ">= 0.12.26"
10+
required_version = ">= 1.0"
11+
12+
required_providers {
13+
azurerm = {
14+
source = "hashicorp/azurerm"
15+
version = "~> 4.0"
16+
}
17+
}
1418
}
1519

1620
# ------------------------------------------------------------------------------

examples/azure/terraform-azure-availabilityset-example/main.tf

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,21 @@
55
# ---------------------------------------------------------------------------------------------------------------------
66
# See test/azure/terraform_azure_availabilityset_example_test.go for how to write automated tests for this code.
77
# ---------------------------------------------------------------------------------------------------------------------
8-
provider "azurerm" {
9-
features {}
10-
}
11-
12-
# ---------------------------------------------------------------------------------------------------------------------
13-
# PIN TERRAFORM VERSION TO >= 0.12
14-
# The examples have been upgraded to 0.12 syntax
15-
# ---------------------------------------------------------------------------------------------------------------------
168
terraform {
17-
# This module is now only being tested with Terraform 0.13.x. However, to make upgrading easier, we are setting
18-
# 0.12.26 as the minimum version, as that version added support for required_providers with source URLs, making it
19-
# forwards compatible with 0.13.x code.
20-
required_version = ">= 0.12.26"
9+
required_version = ">= 1.0"
10+
2111
required_providers {
2212
azurerm = {
23-
version = "~> 2.50"
2413
source = "hashicorp/azurerm"
14+
version = "~> 4.0"
2515
}
2616
}
2717
}
2818

19+
provider "azurerm" {
20+
features {}
21+
}
22+
2923
# ---------------------------------------------------------------------------------------------------------------------
3024
# DEPLOY A RESOURCE GROUP
3125
# ---------------------------------------------------------------------------------------------------------------------

examples/azure/terraform-azure-container-apps-example/main.tf

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,21 @@
55
# See test/azure/terraform_azure_container_apps_test.go for how to write automated tests for this code.
66
# ---------------------------------------------------------------------------------------------------------------------
77

8-
provider "azurerm" {
9-
features {}
10-
}
11-
12-
13-
# ---------------------------------------------------------------------------------------------------------------------
14-
# PIN TERRAFORM VERSION TO >= 0.12
15-
# The examples have been upgraded to 0.12 syntax
16-
# ---------------------------------------------------------------------------------------------------------------------
17-
188
terraform {
19-
# This module is now only being tested with Terraform 0.13.x. However, to make upgrading easier, we are setting
20-
# 0.12.26 as the minimum version, as that version added support for required_providers with source URLs, making it
21-
# forwards compatible with 0.13.x code.
22-
required_version = ">= 0.12.26"
9+
required_version = ">= 1.0"
10+
2311
required_providers {
2412
azurerm = {
25-
version = "~> 3.103"
2613
source = "hashicorp/azurerm"
14+
version = "~> 4.0"
2715
}
2816
}
2917
}
3018

19+
provider "azurerm" {
20+
features {}
21+
}
22+
3123
# ---------------------------------------------------------------------------------------------------------------------
3224
# DEPLOY A RESOURCE GROUP
3325
# ---------------------------------------------------------------------------------------------------------------------

examples/azure/terraform-azure-cosmosdb-example/main.tf

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,21 @@
55
# See test/azure/terraform_azure_example_test.go for how to write automated tests for this code.
66
# ---------------------------------------------------------------------------------------------------------------------
77

8-
provider "azurerm" {
9-
features {}
10-
}
11-
12-
# ---------------------------------------------------------------------------------------------------------------------
13-
# PIN TERRAFORM VERSION TO >= 0.12
14-
# The examples have been upgraded to 0.12 syntax
15-
# ---------------------------------------------------------------------------------------------------------------------
16-
178
terraform {
18-
# This module is now only being tested with Terraform 0.13.x. However, to make upgrading easier, we are setting
19-
# 0.12.26 as the minimum version, as that version added support for required_providers with source URLs, making it
20-
# forwards compatible with 0.13.x code.
21-
required_version = ">= 0.12.26"
9+
required_version = ">= 1.0"
10+
2211
required_providers {
2312
azurerm = {
24-
version = "~> 2.29"
2513
source = "hashicorp/azurerm"
14+
version = "~> 3.0"
2615
}
2716
}
2817
}
2918

19+
provider "azurerm" {
20+
features {}
21+
}
22+
3023

3124

3225
# ---------------------------------------------------------------------------------------------------------------------

examples/azure/terraform-azure-datafactory-example/main.tf

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,20 @@
99
# CONFIGURE OUR AZURE CONNECTION
1010
# ---------------------------------------------------------------------------------------------------------------------
1111
terraform {
12+
required_version = ">= 1.0"
13+
1214
required_providers {
1315
azurerm = {
14-
version = "~> 2.93.0"
1516
source = "hashicorp/azurerm"
17+
version = "~> 4.0"
18+
}
19+
random = {
20+
source = "hashicorp/random"
21+
version = "~> 3.0"
1622
}
1723
}
1824
}
25+
1926
provider "azurerm" {
2027
features {}
2128
}

examples/azure/terraform-azure-disk-example/main.tf

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,21 @@
55
# See test/azure/terraform_azure_disk_example_test.go for how to write automated tests for this code.
66
# ---------------------------------------------------------------------------------------------------------------------
77

8-
provider "azurerm" {
9-
features {}
10-
}
11-
128
terraform {
13-
# This module is now only being tested with Terraform 0.13.x. However, to make upgrading easier, we are setting
14-
# 0.12.26 as the minimum version, as that version added support for required_providers with source URLs, making it
15-
# forwards compatible with 0.13.x code.
16-
required_version = ">= 0.12.26"
9+
required_version = ">= 1.0"
10+
1711
required_providers {
1812
azurerm = {
19-
version = "~> 2.29"
2013
source = "hashicorp/azurerm"
14+
version = "~> 4.0"
2115
}
2216
}
2317
}
2418

19+
provider "azurerm" {
20+
features {}
21+
}
22+
2523
# ---------------------------------------------------------------------------------------------------------------------
2624
# DEPLOY A RESOURCE GROUP
2725
# ---------------------------------------------------------------------------------------------------------------------

examples/azure/terraform-azure-example/main.tf

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,21 @@
55
# See test/azure/terraform_azure_example_test.go for how to write automated tests for this code.
66
# ---------------------------------------------------------------------------------------------------------------------
77

8-
provider "azurerm" {
9-
features {}
10-
}
11-
12-
13-
# ---------------------------------------------------------------------------------------------------------------------
14-
# PIN TERRAFORM VERSION TO >= 0.12
15-
# The examples have been upgraded to 0.12 syntax
16-
# ---------------------------------------------------------------------------------------------------------------------
17-
188
terraform {
19-
# This module is now only being tested with Terraform 0.13.x. However, to make upgrading easier, we are setting
20-
# 0.12.26 as the minimum version, as that version added support for required_providers with source URLs, making it
21-
# forwards compatible with 0.13.x code.
22-
required_version = ">= 0.12.26"
9+
required_version = ">= 1.0"
10+
2311
required_providers {
2412
azurerm = {
25-
version = "~> 2.50"
2613
source = "hashicorp/azurerm"
14+
version = "~> 4.0"
2715
}
2816
}
2917
}
3018

19+
provider "azurerm" {
20+
features {}
21+
}
22+
3123
# ---------------------------------------------------------------------------------------------------------------------
3224
# DEPLOY A RESOURCE GROUP
3325
# ---------------------------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)