updates to vnet code and test
This commit is contained in:
		@@ -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
 | 
			
		||||
@@ -88,7 +93,7 @@ resource "azurerm_policy_definition" "network_group_policy" {
 | 
			
		||||
            "allOf": [
 | 
			
		||||
              {
 | 
			
		||||
              "field": "Name",
 | 
			
		||||
              "contains": "vnet"
 | 
			
		||||
              "contains": "${random_pet.virtual_network_name.id}"
 | 
			
		||||
              }
 | 
			
		||||
            ]
 | 
			
		||||
          }
 | 
			
		||||
 
 | 
			
		||||
@@ -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)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user