Skip to content

Commit

Permalink
[UPDATE] add feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
HappyTobi committed May 10, 2022
1 parent f19c6ed commit f0e86b1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,12 @@ func resourceVirtualNetworkGatewayConnection() *pluginsdk.Resource {
MaxItems: 1,
Elem: &pluginsdk.Resource{
Schema: map[string]*pluginsdk.Schema{
"primary_address": {
"primary": {
Type: pluginsdk.TypeString,
Required: true,
ValidateFunc: validation.Any(validation.IsIPv4Address),
},
"secondary_address": {
"secondary": {
Type: pluginsdk.TypeString,
Required: true,
ValidateFunc: validation.Any(validation.IsIPv4Address),
Expand Down Expand Up @@ -744,8 +744,8 @@ func expandGatewayCustomBgpIPAddresses(d *pluginsdk.ResourceData, bgpPeeringAddr
}

bgAs := bgpAddresses[0].(map[string]interface{})
primaryAddress := bgAs["primary_address"].(string)
secondaryAddress := bgAs["secondary_address"].(string)
primaryAddress := bgAs["primary"].(string)
secondaryAddress := bgAs["secondary"].(string)

var primaryIpConfiguration *string
var secondaryIpConfiguration *string
Expand Down Expand Up @@ -810,8 +810,8 @@ func flattenGatewayCustomBgpIPAddresses(gatewayCustomBgpIPAddresses *[]network.G
if len(*gatewayCustomBgpIPAddresses) == 2 {
addresses := *gatewayCustomBgpIPAddresses
customBgpIpAdresses = append(customBgpIpAdresses, map[string]interface{}{
"primary_address": addresses[0].CustomBgpIPAddress,
"secondary_address": addresses[1].CustomBgpIPAddress,
"primary": addresses[0].CustomBgpIPAddress,
"secondary": addresses[1].CustomBgpIPAddress,
})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ func TestAccVirtualNetworkGatewayConnection_useCustomBgpAddresses(t *testing.T)
Config: r.useCustomBgpAddresses(data),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
check.That(data.ResourceName).Key("custom_bgp_addresses.0.primary_address").HasValue("169.254.21.2"),
check.That(data.ResourceName).Key("custom_bgp_addresses.0.secondary_address").HasValue("169.254.21.6"),
check.That(data.ResourceName).Key("custom_bgp_addresses.0.primary").HasValue("169.254.21.2"),
check.That(data.ResourceName).Key("custom_bgp_addresses.0.secondary").HasValue("169.254.21.6"),
),
},
data.ImportStep(),
Expand Down Expand Up @@ -1229,8 +1229,8 @@ resource "azurerm_virtual_network_gateway_connection" "test" {
enable_bgp = true
custom_bgp_addresses {
primary_address = "169.254.21.2"
secondary_address = "169.254.21.6"
primary = "169.254.21.2"
secondary = "169.254.21.6"
}
}
`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ output "virtual_network_gateway_connection_id" {
* `tags` - A mapping of tags to assign to the resource.

The `custom_bgp_addresses` block supports:
* `primary_address` (Required) single IP address that is part of the `azurerm_virtual_network_gateway` ip_configuration (first one)
* `secondary_address` (Required) single IP address that is part of the `azurerm_virtual_network_gateway` ip_configuration (second one)
* `primary` (Required) single IP address that is part of the `azurerm_virtual_network_gateway` ip_configuration (first one)
* `secondary` (Required) single IP address that is part of the `azurerm_virtual_network_gateway` ip_configuration (second one)

The `ipsec_policy` block supports:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,8 @@ Changing this value will force a resource to be created.
* `tags` - (Optional) A mapping of tags to assign to the resource.

The `custom_bgp_addresses` block supports:
* `primary_address` (Required) single IP address that is part of the `azurerm_virtual_network_gateway` ip_configuration (first one)
* `secondary_address` (Required) single IP address that is part of the `azurerm_virtual_network_gateway` ip_configuration (second one)
* `primary` (Required) single IP address that is part of the `azurerm_virtual_network_gateway` ip_configuration (first one)
* `secondary` (Required) single IP address that is part of the `azurerm_virtual_network_gateway` ip_configuration (second one)

The `ipsec_policy` block supports:

Expand Down

0 comments on commit f0e86b1

Please sign in to comment.