Skip to content

Commit

Permalink
Update address_prefix to address_prefixes in vnet.tf
Browse files Browse the repository at this point in the history
  • Loading branch information
Pwd9000-ML committed Sep 7, 2024
1 parent 90fce7f commit 0a2e4f5
Show file tree
Hide file tree
Showing 16 changed files with 110 additions and 124 deletions.
6 changes: 3 additions & 3 deletions 01_Foundation/main.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
terraform {
required_version = ">= 1.5.0"
required_version = ">= 1.9.5"
backend "azurerm" {}
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~> 4.0.1"
version = "~> 4.0"
}
}
}
Expand All @@ -15,5 +15,5 @@ provider "azurerm" {
purge_soft_delete_on_destroy = true
}
}
skip_provider_registration = true
resource_provider_registrations = "none"
}
30 changes: 14 additions & 16 deletions 02_Storage/config-dev.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,23 @@ location = "UKSouth"
storage_config = [
#V2 Storage
{
name = "pwd9000v2devsa"
account_kind = "StorageV2"
account_tier = "Standard"
account_replication_type = "LRS"
min_tls_version = "TLS1_2"
enable_https_traffic_only = true
access_tier = "Cool"
is_hns_enabled = false
name = "pwd9000v2devsa"
account_kind = "StorageV2"
account_tier = "Standard"
account_replication_type = "LRS"
min_tls_version = "TLS1_2"
access_tier = "Cool"
is_hns_enabled = false
},
#ADLS2 Storage
{
name = "pwd9000adls2devsa"
account_kind = "BlockBlobStorage"
account_tier = "Premium"
account_replication_type = "ZRS"
min_tls_version = "TLS1_2"
enable_https_traffic_only = false
access_tier = "Hot"
is_hns_enabled = true
name = "pwd9000adls2devsa"
account_kind = "BlockBlobStorage"
account_tier = "Premium"
account_replication_type = "ZRS"
min_tls_version = "TLS1_2"
access_tier = "Hot"
is_hns_enabled = true
}
]

Expand Down
30 changes: 14 additions & 16 deletions 02_Storage/config-prod.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,23 @@ location = "UKSouth"
storage_config = [
#V2 Storage
{
name = "pwd9000v2prodsa"
account_kind = "StorageV2"
account_tier = "Standard"
account_replication_type = "LRS"
min_tls_version = "TLS1_2"
enable_https_traffic_only = true
access_tier = "Cool"
is_hns_enabled = false
name = "pwd9000v2prodsa"
account_kind = "StorageV2"
account_tier = "Standard"
account_replication_type = "LRS"
min_tls_version = "TLS1_2"
access_tier = "Cool"
is_hns_enabled = false
},
#ADLS2 Storage
{
name = "pwd9000adls2prodsa"
account_kind = "BlockBlobStorage"
account_tier = "Premium"
account_replication_type = "ZRS"
min_tls_version = "TLS1_2"
enable_https_traffic_only = false
access_tier = "Hot"
is_hns_enabled = true
name = "pwd9000adls2prodsa"
account_kind = "BlockBlobStorage"
account_tier = "Premium"
account_replication_type = "ZRS"
min_tls_version = "TLS1_2"
access_tier = "Hot"
is_hns_enabled = true
}
]

Expand Down
30 changes: 14 additions & 16 deletions 02_Storage/config-uat.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,23 @@ location = "UKSouth"
storage_config = [
#V2 Storage
{
name = "pwd9000v2uatsa"
account_kind = "StorageV2"
account_tier = "Standard"
account_replication_type = "LRS"
min_tls_version = "TLS1_2"
enable_https_traffic_only = true
access_tier = "Cool"
is_hns_enabled = false
name = "pwd9000v2uatsa"
account_kind = "StorageV2"
account_tier = "Standard"
account_replication_type = "LRS"
min_tls_version = "TLS1_2"
access_tier = "Cool"
is_hns_enabled = false
},
#ADLS2 Storage
{
name = "pwd9000adls2uatsa"
account_kind = "BlockBlobStorage"
account_tier = "Premium"
account_replication_type = "ZRS"
min_tls_version = "TLS1_2"
enable_https_traffic_only = false
access_tier = "Hot"
is_hns_enabled = true
name = "pwd9000adls2uatsa"
account_kind = "BlockBlobStorage"
account_tier = "Premium"
account_replication_type = "ZRS"
min_tls_version = "TLS1_2"
access_tier = "Hot"
is_hns_enabled = true
}
]

Expand Down
6 changes: 3 additions & 3 deletions 02_Storage/main.tf
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
terraform {
required_version = ">= 1.5.0"
required_version = ">= 1.9.5"
backend "azurerm" {}
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~> 4.0.1"
version = "~> 4.0"
}
}
}
provider "azurerm" {
features {}
skip_provider_registration = true
resource_provider_registrations = "none"
}
15 changes: 7 additions & 8 deletions 02_Storage/storage_resources.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ resource "azurerm_storage_account" "sas" {
location = var.location

#values from variable config object
name = "${lower(var.storage_config[count.index].name)}${random_integer.sa_num.result}"
account_kind = var.storage_config[count.index].account_kind
account_tier = var.storage_config[count.index].account_tier
account_replication_type = var.storage_config[count.index].account_replication_type
access_tier = var.storage_config[count.index].access_tier
enable_https_traffic_only = var.storage_config[count.index].enable_https_traffic_only
min_tls_version = var.storage_config[count.index].min_tls_version
is_hns_enabled = var.storage_config[count.index].is_hns_enabled
name = "${lower(var.storage_config[count.index].name)}${random_integer.sa_num.result}"
account_kind = var.storage_config[count.index].account_kind
account_tier = var.storage_config[count.index].account_tier
account_replication_type = var.storage_config[count.index].account_replication_type
access_tier = var.storage_config[count.index].access_tier
min_tls_version = var.storage_config[count.index].min_tls_version
is_hns_enabled = var.storage_config[count.index].is_hns_enabled

#Apply tags
tags = var.tags
Expand Down
15 changes: 7 additions & 8 deletions 02_Storage/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ variable "location" {

variable "storage_config" {
type = list(object({
name = string
account_kind = string
account_tier = string
account_replication_type = string
access_tier = string
enable_https_traffic_only = bool
min_tls_version = string
is_hns_enabled = bool
name = string
account_kind = string
account_tier = string
account_replication_type = string
access_tier = string
min_tls_version = string
is_hns_enabled = bool
}))
}

Expand Down
6 changes: 3 additions & 3 deletions 03_etc_etc/another_terraform_module.tf
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
terraform {
required_version = ">= 1.5.0"
required_version = ">= 1.9.5"
backend "azurerm" {}
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~> 4.0.1"
version = "~> 4.0"
}
}
}
provider "azurerm" {
features {}
skip_provider_registration = true
resource_provider_registrations = "none"
}

### Another awesome Terraform ROOT module ###
Expand Down
3 changes: 1 addition & 2 deletions 04_App_Acr/appservices.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ resource "azurerm_linux_web_app" "APPSVC" {
container_registry_use_managed_identity = true
ftps_state = "FtpsOnly"
application_stack {
docker_image = "${var.acr_name}.azurecr.io/${var.appsvc_name}"
docker_image_tag = "latest"
docker_image_name = "${var.acr_name}.azurecr.io/${var.appsvc_name}:latest"
}
vnet_route_all_enabled = var.vnet_route_all_enabled
}
Expand Down
6 changes: 3 additions & 3 deletions 04_App_Acr/main.tf
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
terraform {
required_version = ">= 1.5.0"
required_version = ">= 1.9.5"
backend "azurerm" {}
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~> 3.0.1"
version = "~> 4.0"
}
}
}
provider "azurerm" {
features {}
skip_provider_registration = true
resource_provider_registrations = "none"
}
4 changes: 2 additions & 2 deletions 04_App_Acr/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ variable "vnet_address_space" {

variable "vnet_subnets" {
type = list(object({
name = string
address_prefix = string
name = string
address_prefixes = list(string)
}))
description = "Specifies a list of subnet objects of the virtual network that will be created."
default = []
Expand Down
4 changes: 2 additions & 2 deletions 04_App_Acr/vnet.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ resource "azurerm_virtual_network" "VNET" {
dynamic "subnet" {
for_each = var.vnet_subnets
content {
name = subnet.value.name
address_prefix = subnet.value.address_prefix
name = subnet.value.name
address_prefixes = subnet.value.address_prefixes
}
}

Expand Down
45 changes: 21 additions & 24 deletions 05_lookup_demo/config-dev.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,32 @@ tags = {
storage_config = [
#V2 Storage - SiteA
{
name = "pwd9000v2sitea"
account_kind = "StorageV2"
account_tier = "Standard"
account_replication_type = "LRS"
enable_https_traffic_only = true
access_tier = "Hot"
is_hns_enabled = false
site_name = "siteA"
name = "pwd9000v2sitea"
account_kind = "StorageV2"
account_tier = "Standard"
account_replication_type = "LRS"
access_tier = "Hot"
is_hns_enabled = false
site_name = "siteA"
},
#ADLS2 Storage - SiteA
{
name = "pwd9000dfssitea"
account_kind = "BlockBlobStorage"
account_tier = "Premium"
account_replication_type = "ZRS"
enable_https_traffic_only = true
access_tier = "Hot"
is_hns_enabled = true
site_name = "siteA"
name = "pwd9000dfssitea"
account_kind = "BlockBlobStorage"
account_tier = "Premium"
account_replication_type = "ZRS"
access_tier = "Hot"
is_hns_enabled = true
site_name = "siteA"
},
#V2 Storage - SiteB
{
name = "pwd9000v2siteb"
account_kind = "StorageV2"
account_tier = "Standard"
account_replication_type = "LRS"
enable_https_traffic_only = false
access_tier = "Hot"
is_hns_enabled = false
site_name = "siteB"
name = "pwd9000v2siteb"
account_kind = "StorageV2"
account_tier = "Standard"
account_replication_type = "LRS"
access_tier = "Hot"
is_hns_enabled = false
site_name = "siteB"
}
]
6 changes: 3 additions & 3 deletions 05_lookup_demo/main.tf
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
terraform {
required_version = ">= 1.5.0"
required_version = ">= 1.9.5"
backend "azurerm" {}
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~> 3.1.0"
version = "~> 4.0."
}
}
}
provider "azurerm" {
features {}
skip_provider_registration = true
resource_provider_registrations = "none"
}
13 changes: 6 additions & 7 deletions 05_lookup_demo/storage_resources.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@ resource "azurerm_storage_account" "SAS" {
location = azurerm_resource_group.RGS[each.value.site_name].location

#values from variable storage_config objects
name = "${lower(each.value.name)}${random_integer.sa_num.result}"
account_kind = each.value.account_kind
account_tier = each.value.account_tier
account_replication_type = each.value.account_replication_type
access_tier = each.value.access_tier
enable_https_traffic_only = each.value.enable_https_traffic_only
is_hns_enabled = each.value.is_hns_enabled
name = "${lower(each.value.name)}${random_integer.sa_num.result}"
account_kind = each.value.account_kind
account_tier = each.value.account_tier
account_replication_type = each.value.account_replication_type
access_tier = each.value.access_tier
is_hns_enabled = each.value.is_hns_enabled

#Lookup allowed ips
network_rules {
Expand Down
15 changes: 7 additions & 8 deletions 05_lookup_demo/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ variable "site_names" {

variable "storage_config" {
type = list(object({
name = string
account_kind = string
account_tier = string
account_replication_type = string
access_tier = string
enable_https_traffic_only = bool
is_hns_enabled = bool
site_name = string
name = string
account_kind = string
account_tier = string
account_replication_type = string
access_tier = string
is_hns_enabled = bool
site_name = string
}))
default = []
description = "Provide a list of Storage Configs"
Expand Down

0 comments on commit 0a2e4f5

Please sign in to comment.