generated from clouddrove/terraform-module-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add example for vnet peering in different subscription
- Loading branch information
1 parent
3ab6539
commit 543c22a
Showing
10 changed files
with
196 additions
and
24 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
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,64 @@ | ||
provider "azurerm" { | ||
features {} | ||
} | ||
|
||
module "resource_group_1" { | ||
source = "clouddrove/resource-group/azure" | ||
version = "1.0.1" | ||
|
||
name = "vnet" | ||
environment = "test" | ||
label_order = ["name", "environment"] | ||
location = "North Europe" | ||
} | ||
|
||
|
||
#Vnet | ||
module "vnet" { | ||
source = "clouddrove/vnet/azure" | ||
version = "1.0.0" | ||
|
||
name = "app" | ||
environment = "example" | ||
label_order = ["name", "environment"] | ||
|
||
resource_group_name = module.resource_group_1.resource_group_name | ||
location = module.resource_group_1.resource_group_location | ||
address_space = "10.0.0.0/24" | ||
enable_ddos_pp = false | ||
} | ||
|
||
|
||
provider "azurerm" { | ||
alias = "mgmt" | ||
features {} | ||
subscription_id = "8XXXXXXXXXXXXXXXX53b2a80" | ||
} | ||
|
||
data "azurerm_resource_group" "mgmt-rg" { | ||
provider = azurerm.mgmt | ||
name = "example-rg" | ||
} | ||
|
||
data "azurerm_virtual_network" "mgmt-staging-vnet" { | ||
provider = azurerm.mgmt | ||
name = "example-vnet" | ||
resource_group_name = data.azurerm_resource_group.mgmt-rg.name | ||
} | ||
|
||
module "vnet_peering" { | ||
source = "../.." | ||
|
||
enabled_diff_subs_peering = true | ||
resource_group_1_name = module.resource_group_1.resource_group_name | ||
diff_subs_resource_group_name = data.azurerm_resource_group.mgmt-rg.name | ||
|
||
alias_subs_id = "82XXXXXXXXXXXXXXXXXXXXa80" | ||
vnet_1_name = module.vnet.vnet_name[0] | ||
vnet_1_id = module.vnet.vnet_id[0] | ||
vnet_diff_subs_name = data.azurerm_virtual_network.mgmt-staging-vnet.name | ||
vnet_diff_subs_id = data.azurerm_virtual_network.mgmt-staging-vnet.id | ||
|
||
} | ||
|
||
|
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,19 @@ | ||
output "vnet_peer_1_id" { | ||
value = module.vnet_peering.*.vnet_peer_1_id | ||
description = "The id of the newly created virtual network peering in on first virtual netowork." | ||
} | ||
|
||
output "vnet_peer_1_name" { | ||
value = module.vnet_peering.*.vnet_peer_1_name | ||
description = "The name of the newly created virtual network peering in on first virtual netowork." | ||
} | ||
|
||
output "vnet_peer_diff_subs_id" { | ||
value = module.vnet_peering.*.vnet_peer_diff_subs_id | ||
description = "The id of the newly created virtual network peering in on different subscription virtual network." | ||
} | ||
|
||
output "vnet_peer_diff_subs_name" { | ||
value = module.vnet_peering.*.vnet_peer_diff_subs_name | ||
description = "The name of the newly created virtual network peering in on different subscription virtual network." | ||
} |
File renamed without changes.
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
File renamed without changes.
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,13 @@ | ||
# Terraform version | ||
terraform { | ||
required_version = ">= 1.0.0" | ||
} | ||
|
||
terraform { | ||
required_providers { | ||
azurerm = { | ||
source = "hashicorp/azurerm" | ||
version = ">=2.90.0" | ||
} | ||
} | ||
} |
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