Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data Source: azurerm_virtual_network_gateway - support new property private_ip_address #21432

Merged
merged 3 commits into from
Apr 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions website/docs/d/virtual_network_gateway.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down