diff --git a/internal/services/network/virtual_network_gateway_data_source.go b/internal/services/network/virtual_network_gateway_data_source.go index 05945c24dc0e..028c9545041a 100644 --- a/internal/services/network/virtual_network_gateway_data_source.go +++ b/internal/services/network/virtual_network_gateway_data_source.go @@ -4,6 +4,7 @@ import ( "fmt" "time" + "github.com/hashicorp/go-azure-helpers/lang/pointer" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" @@ -96,6 +97,11 @@ func dataSourceVirtualNetworkGateway() *pluginsdk.Resource { Computed: true, }, + "private_ip_address": { + Type: pluginsdk.TypeString, + Computed: true, + }, + "public_ip_address_id": { Type: pluginsdk.TypeString, Computed: true, @@ -310,6 +316,7 @@ func flattenVirtualNetworkGatewayDataSourceIPConfigurations(ipConfigs *[]network for _, cfg := range *ipConfigs { props := cfg.VirtualNetworkGatewayIPConfigurationPropertiesFormat v := make(map[string]interface{}) + v["private_ip_address"] = pointer.From(props.PrivateIPAddress) if id := cfg.ID; id != nil { v["id"] = *id diff --git a/website/docs/d/virtual_network_gateway.html.markdown b/website/docs/d/virtual_network_gateway.html.markdown index 3b727fd80468..8a19c7cbf682 100644 --- a/website/docs/d/virtual_network_gateway.html.markdown +++ b/website/docs/d/virtual_network_gateway.html.markdown @@ -74,6 +74,8 @@ The `ip_configuration` block supports: the associated subnet is named `GatewaySubnet`. Therefore, each virtual network can contain at most a single Virtual Network Gateway. +* `private_ip_address` - The Private IP Address associated with the Virtual Network Gateway. + * `public_ip_address_id` - The ID of the Public IP Address associated with the Virtual Network Gateway.