Skip to content

Commit

Permalink
updates to vnet code and test
Browse files Browse the repository at this point in the history
  • Loading branch information
mbender-ms committed Jun 27, 2023
1 parent 8fedbd9 commit a966811
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions quickstart/101-virtual-network-manager-create-mesh/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,14 @@ resource "azurerm_resource_group" "rg" {
}

# Create three virtual networks
resource "random_string" "prefix" {
length = 4
special = false
upper = false
}

resource "random_pet" "virtual_network_name" {
prefix = "vnet"
prefix = "vnet-${random_string.prefix.result}"
}
resource "azurerm_virtual_network" "vnet" {
count = 3
Expand Down Expand Up @@ -88,7 +93,7 @@ resource "azurerm_policy_definition" "network_group_policy" {
"allOf": [
{
"field": "Name",
"contains": "vnet"
"contains": "${random_pet.virtual_network_name.id}"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ This template deploys an Azure Virtual Network Manager instance with a connectiv
## Terraform resource types

- [random_pet](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/pet)
- [random_string](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string)
- [azurerm_resource_group](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group)
- [azurerm_virtual_network](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/virtual_network)
- [azurerm_subnet](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/subnet)
Expand Down

0 comments on commit a966811

Please sign in to comment.