Skip to content

Commit

Permalink
Merge pull request #1312 from HadwaAbdelhalem/update_azure_modules_pr…
Browse files Browse the repository at this point in the history
…ovider

Update Azure example to move the azurerm provider version constraint into the required_provider.
  • Loading branch information
denis256 committed Jun 23, 2023
2 parents b8689cd + 7e2df9f commit a86c8a5
Show file tree
Hide file tree
Showing 22 changed files with 164 additions and 32 deletions.
10 changes: 9 additions & 1 deletion examples/azure/terraform-azure-aci-example/main.tf
Expand Up @@ -8,8 +8,16 @@
# CONFIGURE OUR AZURE CONNECTION
# ------------------------------------------------------------------------------

terraform {
required_providers {
azurerm = {
version = "~>2.29.0"
source = "hashicorp/azurerm"
}
}
}

provider "azurerm" {
version = "~>2.29.0"
features {}
}

Expand Down
10 changes: 9 additions & 1 deletion examples/azure/terraform-azure-acr-example/main.tf
Expand Up @@ -8,8 +8,16 @@
# CONFIGURE OUR AZURE CONNECTION
# ------------------------------------------------------------------------------

terraform {
required_providers {
azurerm = {
version = "~>2.29.0"
source = "hashicorp/azurerm"
}
}
}

provider "azurerm" {
version = "~>2.29.0"
features {}
}

Expand Down
Expand Up @@ -5,22 +5,25 @@
# ---------------------------------------------------------------------------------------------------------------------
# See test/azure/terraform_azure_availabilityset_example_test.go for how to write automated tests for this code.
# ---------------------------------------------------------------------------------------------------------------------

provider "azurerm" {
version = "~> 2.50"
features {}
}

# ---------------------------------------------------------------------------------------------------------------------
# PIN TERRAFORM VERSION TO >= 0.12
# The examples have been upgraded to 0.12 syntax
# ---------------------------------------------------------------------------------------------------------------------

terraform {
# This module is now only being tested with Terraform 0.13.x. However, to make upgrading easier, we are setting
# 0.12.26 as the minimum version, as that version added support for required_providers with source URLs, making it
# forwards compatible with 0.13.x code.
required_version = ">= 0.12.26"
required_providers {
azurerm = {
version = "~> 2.50"
source = "hashicorp/azurerm"
}
}
}

# ---------------------------------------------------------------------------------------------------------------------
Expand Down
10 changes: 8 additions & 2 deletions examples/azure/terraform-azure-cosmosdb-example/main.tf
Expand Up @@ -6,11 +6,9 @@
# ---------------------------------------------------------------------------------------------------------------------

provider "azurerm" {
version = "~> 2.29"
features {}
}


# ---------------------------------------------------------------------------------------------------------------------
# PIN TERRAFORM VERSION TO >= 0.12
# The examples have been upgraded to 0.12 syntax
Expand All @@ -21,8 +19,16 @@ terraform {
# 0.12.26 as the minimum version, as that version added support for required_providers with source URLs, making it
# forwards compatible with 0.13.x code.
required_version = ">= 0.12.26"
required_providers {
azurerm = {
version = "~> 2.29"
source = "hashicorp/azurerm"
}
}
}



# ---------------------------------------------------------------------------------------------------------------------
# DEPLOY A RESOURCE GROUP
# ---------------------------------------------------------------------------------------------------------------------
Expand Down
10 changes: 8 additions & 2 deletions examples/azure/terraform-azure-datafactory-example/main.tf
Expand Up @@ -8,9 +8,15 @@
# ---------------------------------------------------------------------------------------------------------------------
# CONFIGURE OUR AZURE CONNECTION
# ---------------------------------------------------------------------------------------------------------------------

terraform {
required_providers {
azurerm = {
version = "~> 2.93.0"
source = "hashicorp/azurerm"
}
}
}
provider "azurerm" {
version = "~>2.93.0"
features {}
}

Expand Down
7 changes: 6 additions & 1 deletion examples/azure/terraform-azure-disk-example/main.tf
Expand Up @@ -6,7 +6,6 @@
# ---------------------------------------------------------------------------------------------------------------------

provider "azurerm" {
version = "~> 2.29"
features {}
}

Expand All @@ -15,6 +14,12 @@ terraform {
# 0.12.26 as the minimum version, as that version added support for required_providers with source URLs, making it
# forwards compatible with 0.13.x code.
required_version = ">= 0.12.26"
required_providers {
azurerm = {
version = "~> 2.29"
source = "hashicorp/azurerm"
}
}
}

# ---------------------------------------------------------------------------------------------------------------------
Expand Down
7 changes: 6 additions & 1 deletion examples/azure/terraform-azure-example/main.tf
Expand Up @@ -6,7 +6,6 @@
# ---------------------------------------------------------------------------------------------------------------------

provider "azurerm" {
version = "~> 2.50"
features {}
}

Expand All @@ -21,6 +20,12 @@ terraform {
# 0.12.26 as the minimum version, as that version added support for required_providers with source URLs, making it
# forwards compatible with 0.13.x code.
required_version = ">= 0.12.26"
required_providers {
azurerm = {
version = "~> 2.50"
source = "hashicorp/azurerm"
}
}
}

# ---------------------------------------------------------------------------------------------------------------------
Expand Down
11 changes: 10 additions & 1 deletion examples/azure/terraform-azure-functionapp-example/main.tf
Expand Up @@ -8,8 +8,17 @@
# ---------------------------------------------------------------------------------------------------------------------
# CONFIGURE OUR AZURE CONNECTION
# ---------------------------------------------------------------------------------------------------------------------

terraform {
required_providers {
azurerm = {
version = "~>2.29.0"
source = "hashicorp/azurerm"
}
}
}

provider "azurerm" {
version = "~>2.29.0"
features {}
}

Expand Down
7 changes: 6 additions & 1 deletion examples/azure/terraform-azure-keyvault-example/main.tf
Expand Up @@ -6,7 +6,6 @@
# ---------------------------------------------------------------------------------------------------------------------

provider "azurerm" {
version = "~>3.0"
features {
key_vault {
purge_soft_delete_on_destroy = false
Expand All @@ -24,6 +23,12 @@ terraform {
# 0.12.26 as the minimum version, as that version added support for required_providers with source URLs, making it
# forwards compatible with 0.13.x code.
required_version = ">= 0.12.26"
required_providers {
azurerm = {
version = "~>3.0"
source = "hashicorp/azurerm"
}
}
}

# ---------------------------------------------------------------------------------------------------------------------
Expand Down
7 changes: 6 additions & 1 deletion examples/azure/terraform-azure-loadbalancer-example/main.tf
Expand Up @@ -6,7 +6,6 @@
# See test/azure/terraform_azure_loadbalancer_example_test.go for how to write automated tests for this code.
# ---------------------------------------------------------------------------------------------------------------------
provider "azurerm" {
version = "~>2.29"
features {}
}

Expand All @@ -20,6 +19,12 @@ terraform {
# 0.12.26 as the minimum version, as that version added support for required_providers with source URLs, making it
# forwards compatible with 0.13.x code.
required_version = ">= 0.12.26"
required_providers {
azurerm = {
version = "~>2.29"
source = "hashicorp/azurerm"
}
}
}

# ---------------------------------------------------------------------------------------------------------------------
Expand Down
7 changes: 6 additions & 1 deletion examples/azure/terraform-azure-loganalytics-example/main.tf
Expand Up @@ -6,7 +6,6 @@
# ---------------------------------------------------------------------------------------------------------------------

provider "azurerm" {
version = "~> 2.20"
features {}
}

Expand All @@ -17,6 +16,12 @@ terraform {
# 0.12.26 as the minimum version, as that version added support for required_providers with source URLs, making it
# forwards compatible with 0.13.x code.
required_version = ">= 0.12.26"
required_providers {
azurerm = {
version = "~> 2.20"
source = "hashicorp/azurerm"
}
}
}

# ---------------------------------------------------------------------------------------------------------------------
Expand Down
17 changes: 10 additions & 7 deletions examples/azure/terraform-azure-monitor-example/main.tf
Expand Up @@ -7,25 +7,28 @@
# ---------------------------------------------------------------------------------------------------------------------

provider "azurerm" {
version = "~> 2.29"

features {
key_vault {
purge_soft_delete_on_destroy = true
}
}
}

# Configure the Microsoft Azure Active Directory Provider
provider "azuread" {
version = "=0.7.0"
}

terraform {
# This module is now only being tested with Terraform 0.13.x. However, to make upgrading easier, we are setting
# 0.12.26 as the minimum version, as that version added support for required_providers with source URLs, making it
# forwards compatible with 0.13.x code.
required_version = ">= 0.12.26"
required_providers {
azurerm = {
version = "~> 2.29"
source = "hashicorp/azurerm"
}
azuread = {
version = "=0.7.0"
source = "hashicorp/azuread"
}
}
}

resource "random_string" "short" {
Expand Down
12 changes: 11 additions & 1 deletion examples/azure/terraform-azure-mysqldb-example/main.tf
Expand Up @@ -8,9 +8,19 @@
# ---------------------------------------------------------------------------------------------------------------------
# CONFIGURE OUR AZURE CONNECTION
# ---------------------------------------------------------------------------------------------------------------------
terraform {
# This module is now only being tested with Terraform 0.13.x. However, to make upgrading easier, we are setting
# 0.12.26 as the minimum version, as that version added support for required_providers with source URLs, making it
# forwards compatible with 0.13.x code.
required_providers {
azurerm = {
version = "~>2.29.0"
source = "hashicorp/azurerm"
}
}
}

provider "azurerm" {
version = "~>2.29.0"
features {}
}

Expand Down
7 changes: 6 additions & 1 deletion examples/azure/terraform-azure-network-example/main.tf
Expand Up @@ -7,7 +7,6 @@
# ---------------------------------------------------------------------------------------------------------------------

provider "azurerm" {
version = "~>2.20"
features {}
}

Expand All @@ -21,6 +20,12 @@ terraform {
# 0.12.26 as the minimum version, as that version added support for required_providers with source URLs, making it
# forwards compatible with 0.13.x code.
required_version = ">= 0.12.26"
required_providers {
azurerm = {
version = "~>2.20"
source = "hashicorp/azurerm"
}
}
}

# ---------------------------------------------------------------------------------------------------------------------
Expand Down
7 changes: 6 additions & 1 deletion examples/azure/terraform-azure-nsg-example/main.tf
Expand Up @@ -7,7 +7,6 @@
# ---------------------------------------------------------------------------------------------------------------------

provider "azurerm" {
version = "~>2.50"
features {}
}

Expand All @@ -18,6 +17,12 @@ provider "azurerm" {

terraform {
required_version = ">= 0.12"
required_providers {
azurerm = {
version = "~> 2.50"
source = "hashicorp/azurerm"
}
}
}

# ---------------------------------------------------------------------------------------------------------------------
Expand Down
Expand Up @@ -7,7 +7,6 @@
# ---------------------------------------------------------------------------------------------------------------------

provider "azurerm" {
version = "~> 2.20"
features {}
}

Expand All @@ -16,6 +15,12 @@ terraform {
# 0.12.26 as the minimum version, as that version added support for required_providers with source URLs, making it
# forwards compatible with 0.13.x code.
required_version = ">= 0.12.26"
required_providers {
azurerm = {
version = "~> 2.20"
source = "hashicorp/azurerm"
}
}
}

# ---------------------------------------------------------------------------------------------------------------------
Expand Down
7 changes: 6 additions & 1 deletion examples/azure/terraform-azure-resourcegroup-example/main.tf
Expand Up @@ -6,7 +6,6 @@
# ---------------------------------------------------------------------------------------------------------------------

provider "azurerm" {
version = "~> 2.20"
features {}
}

Expand All @@ -17,6 +16,12 @@ terraform {
# 0.12.26 as the minimum version, as that version added support for required_providers with source URLs, making it
# forwards compatible with 0.13.x code.
required_version = ">= 0.12.26"
required_providers {
azurerm = {
version = "~> 2.20"
source = "hashicorp/azurerm"
}
}
}

# ---------------------------------------------------------------------------------------------------------------------
Expand Down
12 changes: 11 additions & 1 deletion examples/azure/terraform-azure-servicebus-example/main.tf
Expand Up @@ -10,10 +10,20 @@
# ---------------------------------------------------------------------------------------------------------------------

provider "azurerm" {
version = "~>2.29"
features {}
}

terraform {
# This module is now only being tested with Terraform 0.13.x. However, to make upgrading easier, we are setting
# 0.12.26 as the minimum version, as that version added support for required_providers with source URLs, making it
# forwards compatible with 0.13.x code.
required_providers {
azurerm = {
version = "~>2.29"
source = "hashicorp/azurerm"
}
}
}
# ---------------------------------------------------------------------------------------------------------------------
# DEPLOY A RESOURCE GROUP
# ---------------------------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit a86c8a5

Please sign in to comment.