-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Vnets and Private DNS Zones (#1157)
Co-authored-by: Automatic Update <[email protected]>
- Loading branch information
Showing
20 changed files
with
178 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,6 @@ locals { | |
outputs = { | ||
location = "westeurope" | ||
resource_group = "common-westeurope" | ||
enviroment = "c2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module "resourcegroups" { | ||
for_each = toset(var.resource_groups) | ||
source = "../../../modules/resourcegroups" | ||
name = "${each.value}" | ||
name = each.value | ||
location = local.outputs.location | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,14 @@ | ||
module "resourcegroups" { | ||
for_each = toset(var.resource_groups) | ||
source = "../../../modules/resourcegroups" | ||
name = "${each.value}-${local.external_outputs.common.data.enviroment}" | ||
location = local.external_outputs.common.data.location | ||
} | ||
|
||
module "azurerm_virtual_network" { | ||
source = "../../../modules/virtualnetwork" | ||
location = local.external_outputs.clusters.data.location | ||
enviroment = local.external_outputs.clusters.data.enviroment | ||
location = local.external_outputs.common.data.location | ||
enviroment = local.external_outputs.common.data.enviroment | ||
depends_on = [module.resourcegroups] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
variable "resource_groups" { | ||
type = list(string) | ||
default = ["cluster-vnet-hub"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,6 @@ locals { | |
outputs = { | ||
location = "northeurope" | ||
resource_group = "common" | ||
enviroment = "platform" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module "resourcegroups" { | ||
for_each = toset(var.resource_groups) | ||
source = "../../../modules/resourcegroups" | ||
name = "${each.value}" | ||
name = each.value | ||
location = local.outputs.location | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
module "resourcegroups" { | ||
for_each = toset(var.resource_groups) | ||
source = "../../../modules/resourcegroups" | ||
name = "${each.value}-${local.external_outputs.common.data.enviroment}" | ||
location = local.external_outputs.common.data.location | ||
} | ||
|
||
module "azurerm_virtual_network" { | ||
source = "../../../modules/virtualnetwork" | ||
location = local.external_outputs.clusters.data.location | ||
enviroment = local.external_outputs.clusters.data.enviroment | ||
location = local.external_outputs.common.data.location | ||
enviroment = local.external_outputs.common.data.enviroment | ||
depends_on = [module.resourcegroups] | ||
} |
4 changes: 4 additions & 0 deletions
4
terraform/subscriptions/s940/prod/virtualnetwork/variables.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
variable "resource_groups" { | ||
type = list(string) | ||
default = ["cluster-vnet-hub"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
module "resourcegroups" { | ||
for_each = toset(var.resource_groups) | ||
source = "../../../modules/resourcegroups" | ||
name = "${each.value}-${local.external_outputs.common.data.enviroment}" | ||
location = local.external_outputs.common.data.location | ||
} | ||
|
||
module "azurerm_virtual_network" { | ||
source = "../../../modules/virtualnetwork" | ||
location = local.external_outputs.common.data.location | ||
enviroment = local.external_outputs.common.data.enviroment_S | ||
} | ||
enviroment = local.external_outputs.common.data.enviroment | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
variable "resource_groups" { | ||
type = list(string) | ||
default = ["cluster-vnet-hub"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,38 @@ | ||
module "resourcegroups" { | ||
for_each = toset(var.resource_groups) | ||
source = "../../../modules/resourcegroups" | ||
name = "${each.value}" | ||
name = each.value | ||
location = local.outputs.location | ||
} | ||
} | ||
|
||
module "backupvault" { | ||
source = "../../../modules/backupvaults" | ||
name = "Backupvault-${local.outputs.enviroment}" | ||
resource_group_name = "common-${local.outputs.enviroment}" | ||
location = local.outputs.location | ||
policyblobstoragename = "Backuppolicy-blob" | ||
depends_on = [module.resourcegroups] | ||
} | ||
|
||
# module "storageaccount" { | ||
# source = "../../../modules/storageaccount" | ||
# for_each = var.storageaccounts | ||
# name = "${each.key}${local.outputs.enviroment}" | ||
# tier = each.value.account_tier | ||
# account_replication_type = each.value.account_replication_type | ||
# resource_group_name = each.value.resource_group_name | ||
# location = each.value.location | ||
# environment = local.outputs.enviroment | ||
# kind = each.value.kind | ||
# change_feed_enabled = each.value.change_feed_enabled | ||
# versioning_enabled = each.value.versioning_enabled | ||
# roleassignment = each.value.roleassignment | ||
# principal_id = module.backupvault.data.backupvault.identity[0].principal_id | ||
# vault_id = module.backupvault.data.backupvault.id | ||
# policyblobstorage_id = module.backupvault.data.policyblobstorage.id | ||
# subnet_id = local.external_outputs.virtualnetwork.data.vnet_subnet.id | ||
# vnethub_resource_group = local.external_outputs.virtualnetwork.data.vnet_hub.resource_group_name | ||
# priv_endpoint = each.value.private_endpoint | ||
# firewall = each.value.firewall | ||
# depends_on = [ module.backupvault ] | ||
# } |
23 changes: 23 additions & 0 deletions
23
terraform/subscriptions/s941/playground/common/variables.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,27 @@ | ||
variable "resource_groups" { | ||
type = list(string) | ||
default = ["common-playground"] | ||
} | ||
|
||
variable "storageaccounts" { | ||
description = "Max 15 characters lowercase in the storageaccount name" | ||
type = map(object({ | ||
name = string | ||
resource_group_name = optional(string, "common-playground") | ||
location = optional(string, "northeurope") | ||
account_tier = optional(string, "Standard") | ||
account_replication_type = optional(string, "LRS") | ||
kind = optional(string, "StorageV2") | ||
change_feed_enabled = optional(bool, false) | ||
versioning_enabled = optional(bool, false) | ||
roleassignment = optional(map(object({ backup = optional(bool, false) }))) | ||
principal_id = optional(string) | ||
private_endpoint = optional(bool, false) | ||
firewall = optional(bool, true) | ||
})) | ||
default = { | ||
radixlog = { | ||
name = "radixlog" | ||
} | ||
} | ||
} |
9 changes: 8 additions & 1 deletion
9
terraform/subscriptions/s941/playground/virtualnetwork/main.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
module "resourcegroups" { | ||
for_each = toset(var.resource_groups) | ||
source = "../../../modules/resourcegroups" | ||
name = "${each.value}-${local.external_outputs.common.data.enviroment}" | ||
location = local.external_outputs.common.data.location | ||
} | ||
|
||
module "azurerm_virtual_network" { | ||
source = "../../../modules/virtualnetwork" | ||
location = local.external_outputs.common.data.location | ||
enviroment = local.external_outputs.common.data.enviroment_S | ||
enviroment = local.external_outputs.common.data.enviroment | ||
} |
6 changes: 3 additions & 3 deletions
6
terraform/subscriptions/s941/playground/virtualnetwork/outputs.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
output "data" { | ||
value = module.azurerm_virtual_network.data | ||
} | ||
# output "data" { | ||
# value = module.azurerm_virtual_network.data | ||
# } |
4 changes: 4 additions & 0 deletions
4
terraform/subscriptions/s941/playground/virtualnetwork/variables.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
variable "resource_groups" { | ||
type = list(string) | ||
default = ["cluster-vnet-hub"] | ||
} |