Azure / Enterprise-Scale

The Azure Landing Zones (Enterprise-Scale) architecture provides prescriptive guidance coupled with Azure best practices, and it follows design principles across the critical design areas for organizations to define their Azure architecture
https://aka.ms/alz
MIT License
1.69k stars 963 forks source link

Unable to get the desired names for few resources #1688

Closed ctrlaltcloud closed 3 months ago

ctrlaltcloud commented 3 months ago

Unable to get the desired names for my VPN Gateway and VPN Gateway Public IP

Steps to reproduce

  1. I am using the below mentioned code for getting the desired names for my resources instead of default generated ones.

advanced = { custom_settings_by_resource_type = { azurerm_resource_group = { connectivity = { (var.management_resources_location) = { name = "vnetrg-hub-conn-cac-01" } }, dns = { (var.management_resources_location) = { name = "dnsrg-hub-conn-cac-01" } } } azurerm_virtual_network = { connectivity = { (var.management_resources_location) = { name = "vnet-hub-conn-cac-01" } } } azurerm_virtual_network_gateway = { connectivity = { (var.management_resources_location) = { name = "vgw-hub-conn-cac-01" } } } azurerm_public_ip = { connectivity = { (var.management_resources_location) = { name = "pipvgw-hub-conn-cac-01" } } } } }

I am getting the desired VNet and RG names, however, the VPN gateway and PIP names are module generated one. How can I correct it or is there something wrong with my code? Thanks for the help. Screenshots Code snippet:

code snippet

Terraform plan output:

resource names
ctrlaltcloud commented 3 months ago

Issue is resolved as I was using connectivity instead of connectivity_vpn in my code. The correct code snippet would be:

code snippet
Springstone commented 3 months ago

Great that you managed to resolve the issue on your own. Closing as no further action required.