### Initialize and Apply Terraform Configuration with PowerShell Source: https://github.com/azure/terraform-azurerm-avm-ptn-vnetgateway/blob/main/examples/default/README.md This PowerShell snippet provides the commands to initialize the Terraform working directory, generate an execution plan, and apply the configuration to create the Azure resources defined in the HCL code. ```pwsh terraform init terraform plan terraform apply ``` -------------------------------- ### Define Azure Resources with Terraform HCL Source: https://github.com/azure/terraform-azurerm-avm-ptn-vnetgateway/blob/main/examples/default/README.md This HCL code defines the necessary Azure resources for the default example, including a random ID, resource group, virtual network, and the virtual network gateway module itself. It shows how to instantiate the module with basic parameters. ```hcl resource "random_id" "id" { byte_length = 4 } resource "azurerm_resource_group" "rg" { location = "uksouth" name = "rg-vnetgateway-${random_id.id.hex}" } resource "azurerm_virtual_network" "vnet" { address_space = ["10.0.0.0/16"] location = azurerm_resource_group.rg.location name = "vnet-uksouth-prod" resource_group_name = azurerm_resource_group.rg.name } module "vgw" { source = "../.." location = "uksouth" name = "vgw-uksouth-prod" subnet_address_prefix = "10.0.1.0/24" virtual_network_id = azurerm_virtual_network.vnet.id } ``` -------------------------------- ### Deploying Azure VNet Gateway Module Example - HCL Source: https://github.com/azure/terraform-azurerm-avm-ptn-vnetgateway/blob/main/README.md This example demonstrates how to use the Azure/avm-ptn-vnetgateway module to deploy a Virtual Network Gateway. It includes the creation of a resource group and virtual network as prerequisites for the module. ```HCL resource "azurerm_resource_group" "rg" { location = "uksouth" name = "rg-connectivity-uksouth-prod" } resource "azurerm_virtual_network" "vnet" { address_space = ["10.0.0.0/16"] location = azurerm_resource_group.rg.location name = "vnet-uksouth-prod" resource_group_name = azurerm_resource_group.rg.name } module "vgw" { source = "Azure/avm-ptn-vnetgateway/azurerm" version = "" # change this to your desired version, https://www.terraform.io/language/expressions/version-constraints location = "uksouth" name = "vgw-uksouth-prod" subnet_address_prefix = "10.0.1.0/24" virtual_network_id = azurerm_virtual_network.vnet.id } ``` -------------------------------- ### Deploying Azure VNet Gateway using AVM module Source: https://github.com/azure/terraform-azurerm-avm-ptn-vnetgateway/blob/main/_header.md This example demonstrates how to deploy an Azure Resource Group, a Virtual Network, and then use the `avm-ptn-vnetgateway` Terraform module to deploy a Virtual Network Gateway within the created VNet. It shows the basic required inputs for the module. ```HCL resource "azurerm_resource_group" "rg" { location = "uksouth" name = "rg-connectivity-uksouth-prod" } resource "azurerm_virtual_network" "vnet" { address_space = ["10.0.0.0/16"] location = azurerm_resource_group.rg.location name = "vnet-uksouth-prod" resource_group_name = azurerm_resource_group.rg.name } module "vgw" { source = "Azure/avm-ptn-vnetgateway/azurerm" version = "" # change this to your desired version, https://www.terraform.io/language/expressions/version-constraints location = "uksouth" name = "vgw-uksouth-prod" subnet_address_prefix = "10.0.1.0/24" virtual_network_id = azurerm_virtual_network.vnet.id } ``` -------------------------------- ### Applying Terraform Configuration with PowerShell Source: https://github.com/azure/terraform-azurerm-avm-ptn-vnetgateway/blob/main/examples/vnet-with-subnet/README.md These PowerShell commands demonstrate the standard workflow for applying a Terraform configuration. `terraform init` initializes the working directory, `terraform plan` creates an execution plan, and `terraform apply` applies the changes defined in the plan to create or update infrastructure. ```pwsh terraform init terraform plan terraform apply ``` -------------------------------- ### Deploying Terraform Module (PowerShell) Source: https://github.com/azure/terraform-azurerm-avm-ptn-vnetgateway/blob/main/examples/default/_footer.md This snippet shows the standard commands to initialize, plan, and apply the Terraform configuration for this module using PowerShell. It prepares the working directory, shows the planned changes, and applies those changes to create or update Azure resources. ```pwsh terraform init terraform plan terraform apply ``` -------------------------------- ### Applying Terraform Configuration (pwsh) Source: https://github.com/azure/terraform-azurerm-avm-ptn-vnetgateway/blob/main/examples/vnet-with-subnet/_footer.md This snippet shows the standard commands to initialize, plan, and apply a Terraform configuration using the command line interface. ```terraform terraform init terraform plan terraform apply ``` -------------------------------- ### Deploying Azure VNet Gateway with Terraform HCL Source: https://github.com/azure/terraform-azurerm-avm-ptn-vnetgateway/blob/main/examples/vnet-with-subnet/README.md This Terraform HCL code defines the necessary Azure resources to deploy a virtual network gateway using the specified module. It includes resource groups, a virtual network with a GatewaySubnet, a public IP, and the configuration for the virtual network gateway module, including IP configurations and local network gateways. ```hcl locals { shared_key = sensitive("shared_key") } resource "random_id" "id" { byte_length = 4 } resource "azurerm_resource_group" "rg" { location = "uksouth" name = "rg-vnetgateway-${random_id.id.hex}" } resource "azurerm_resource_group" "rg_two" { location = "uksouth" name = "rg-vnetgateway-${random_id.id.hex}-02" } resource "azurerm_virtual_network" "vnet" { address_space = ["10.0.0.0/16"] location = azurerm_resource_group.rg.location name = "vnet-uksouth-prod" resource_group_name = azurerm_resource_group.rg.name subnet { address_prefixes = ["10.0.0.0/24"] name = "GatewaySubnet" } } resource "azurerm_public_ip" "public_ip" { allocation_method = "Static" location = azurerm_resource_group.rg.location name = "pip-uksouth-prod" resource_group_name = azurerm_resource_group.rg.name sku = "Standard" zones = ["1", "2", "3"] } module "vgw" { source = "../.." location = "uksouth" name = "vgw-uksouth-prod" subnet_address_prefix = "10.0.1.0/24" sku = "VpnGw1AZ" type = "Vpn" virtual_network_id = azurerm_virtual_network.vnet.id subnet_creation_enabled = false vpn_active_active_enabled = true vpn_bgp_enabled = true ip_configurations = { "ip_config_01" = { name = "vnetGatewayConfig01" apipa_addresses = ["169.254.21.1"] }, "ip_config_02" = { name = "vnetGatewayConfig02" apipa_addresses = ["169.254.21.2"] public_ip = { creation_enabled = false id = azurerm_public_ip.public_ip.id } } } local_network_gateways = { gateway-uks = { name = "lgw-gateway" resource_group_name = azurerm_resource_group.rg_two.name gateway_address = "1.1.1.1" address_space = ["196.0.0.0/16"] connection = { type = "IPsec" shared_key = local.shared_key } } } } ``` -------------------------------- ### Define Connection Configuration Object Type - HCL Source: https://github.com/azure/terraform-azurerm-avm-ptn-vnetgateway/blob/main/README.md This HCL snippet defines the structure for the 'connection_configurations' variable, specifying the types and optionality of various properties like protocols, timeouts, NAT rules, BGP settings, shared keys, tags, traffic selectors, and nested custom BGP addresses and IPsec policies. ```HCL object({ connection_protocol = optional(string, null) dpd_timeout_seconds = optional(number, null) egress_nat_rule_ids = optional(list(string), null) enable_bgp = optional(bool, null) ingress_nat_rule_ids = optional(list(string), null) local_azure_ip_address_enabled = optional(bool, null) peer_virtual_network_gateway_id = optional(string, null) routing_weight = optional(number, null) shared_key = optional(string, null) tags = optional(map(string), null) use_policy_based_traffic_selectors = optional(bool, null) custom_bgp_addresses = optional(object({ primary = string secondary = string }), null) ipsec_policy = optional(object({ dh_group = string ike_encryption = string ike_integrity = string ipsec_encryption = string ipsec_integrity = string pfs_group = string sa_datasize = optional(number, null) sa_lifetime = optional(number, null) }), null) traffic_selector_policy = optional(list( object({ local_address_prefixes = list(string) remote_address_prefixes = list(string) }) ), null) }), null) ``` -------------------------------- ### Define VPN BGP Settings Object Type - HCL Source: https://github.com/azure/terraform-azurerm-avm-ptn-vnetgateway/blob/main/README.md This HCL snippet defines the structure for the 'vpn_bgp_settings' variable, specifying the types and optionality for BGP Autonomous System Number (ASN) and peer weight. ```HCL object({ asn = optional(number, 65515) peer_weight = optional(number, null) }) ``` -------------------------------- ### Define vpn_point_to_site Variable Type (HCL) Source: https://github.com/azure/terraform-azurerm-avm-ptn-vnetgateway/blob/main/README.md This HCL code block defines the complex object type for the `vpn_point_to_site` input variable. It specifies the structure and types of various point-to-site configuration attributes, including address space, AAD settings, radius servers, certificates, IPsec policy, and client connections. ```HCL object({ address_space = list(string) aad_tenant = optional(string, null) aad_audience = optional(string, null) aad_issuer = optional(string, null) radius_server_address = optional(string, null) radius_server_secret = optional(string, null) root_certificates = optional(map(object({ name = string public_cert_data = string })), {}) revoked_certificates = optional(map(object({ name = string thumbprint = string })), {}) radius_servers = optional(map(object({ address = string secret = string score = number })), {}) vpn_client_protocols = optional(list(string), null) vpn_auth_types = optional(list(string), null) ipsec_policy = optional(object({ dh_group = string ike_encryption = string ike_integrity = string ipsec_encryption = string ipsec_integrity = string pfs_group = string sa_data_size_in_kilobytes = optional(number, null) sa_lifetime_in_seconds = optional(number, null) }), null) virtual_network_gateway_client_connections = optional(map(object({ name = string policy_group_names = list(string) address_prefixes = list(string) })), {}) }) ``` -------------------------------- ### Define ExpressRoute Circuits Variable Type - HCL Source: https://github.com/azure/terraform-azurerm-avm-ptn-vnetgateway/blob/main/README.md Defines the complex type structure for the `express_route_circuits` variable, which is a map of objects describing ExpressRoute circuit connections and peering configurations for the Virtual Network Gateway. ```HCL map(object({ id = string connection = optional(object({ resource_group_name = optional(string, null) authorization_key = optional(string, null) express_route_gateway_bypass = optional(bool, null) private_link_fast_path_enabled = optional(bool, false) name = optional(string, null) routing_weight = optional(number, null) shared_key = optional(string, null) tags = optional(map(string), {}) }), null) peering = optional(object({ peering_type = string vlan_id = number resource_group_name = optional(string, null) ipv4_enabled = optional(bool, true) peer_asn = optional(number, null) primary_peer_address_prefix = optional(string, null) secondary_peer_address_prefix = optional(string, null) shared_key = optional(string, null) route_filter_id = optional(string, null) microsoft_peering_config = optional(object({ advertised_public_prefixes = list(string) advertised_communities = optional(list(string), null) customer_asn = optional(number, null) routing_registry_name = optional(string, null) }), null) }), null) })) ``` -------------------------------- ### Define IP Configurations Type for Azure VNet Gateway Terraform Source: https://github.com/azure/terraform-azurerm-avm-ptn-vnetgateway/blob/main/README.md This HCL snippet defines the complex type constraint for the 'ip_configurations' input variable in the Terraform module. It specifies that the variable should be a map of objects, detailing the structure for configuring IP settings, including optional public IP addresses with various attributes like allocation method, SKU, zones, and DDoS protection settings. ```HCL map(object({ name = optional(string, null) apipa_addresses = optional(list(string), null) private_ip_address_allocation = optional(string, "Dynamic") public_ip = optional(object({ creation_enabled = optional(bool, true) id = optional(string, null) name = optional(string, null) resource_group_name = optional(string, null) allocation_method = optional(string, "Static") sku = optional(string, "Standard") tags = optional(map(string), {}) zones = optional(list(number), [1, 2, 3]) edge_zone = optional(string, null) ddos_protection_mode = optional(string, "VirtualNetworkInherited") ddos_protection_plan_id = optional(string, null) domain_name_label = optional(string, null) idle_timeout_in_minutes = optional(number, null) ip_tags = optional(map(string), {}) ip_version = optional(string, "IPv4") public_ip_prefix_id = optional(string, null) reverse_fqdn = optional(string, null) sku_tier = optional(string, "Regional") }), {}) })) ``` -------------------------------- ### Define VPN Custom Route Object Type - HCL Source: https://github.com/azure/terraform-azurerm-avm-ptn-vnetgateway/blob/main/README.md This HCL snippet defines the structure for the 'vpn_custom_route' variable, specifying that it is an object containing a list of strings for address prefixes. ```HCL object({ address_prefixes = list(string) }) ``` -------------------------------- ### Define vpn_policy_groups Variable Type (HCL) Source: https://github.com/azure/terraform-azurerm-avm-ptn-vnetgateway/blob/main/README.md This HCL code block defines the map of objects type for the `vpn_policy_groups` input variable. It specifies the structure for configuring VPN policy groups, including name, default status, priority, and a map of policy members with their name, type, and value. ```HCL map(object({ name = string is_default = optional(bool, null) priority = optional(number, null) policy_members = map(object({ name = string type = string value = string })) })) ``` -------------------------------- ### Defining local_network_gateways Variable Type in HCL Source: https://github.com/azure/terraform-azurerm-avm-ptn-vnetgateway/blob/main/README.md This HCL block defines the complex type structure for the `local_network_gateways` input variable, detailing the nested objects and optional/required fields for Local Network Gateways and their connections within a Terraform module. It specifies the expected schema including IDs, names, addresses, BGP settings, and connection configurations. ```HCL map(object({ id = optional(string, null) name = optional(string, null) resource_group_name = optional(string, null) address_space = optional(list(string), null) gateway_fqdn = optional(string, null) gateway_address = optional(string, null) tags = optional(map(string), {}) bgp_settings = optional(object({ asn = number bgp_peering_address = string peer_weight = optional(number, null) }), null) connection = optional(object({ name = optional(string, null) resource_group_name = optional(string, null) type = string connection_mode = optional(string, null) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.