Skip to content

Commit

Permalink
azurerm_virtual_network_gateway_connection: can now be created with…
Browse files Browse the repository at this point in the history
… a `azurerm_virtual_network_gateway` in another resource group (#19699)
  • Loading branch information
freeman authored Dec 16, 2022
1 parent 15f2c79 commit 6093d95
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ func resourceVirtualNetworkGatewayConnectionCreateUpdate(d *pluginsdk.ResourceDa
return err
}

virtualNetworkGateway, err = vnetGatewayClient.Get(ctx, id.ResourceGroup, gwid.Name)
virtualNetworkGateway, err = vnetGatewayClient.Get(ctx, gwid.ResourceGroup, gwid.Name)
if err != nil {
return err
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,11 @@ resource "azurerm_resource_group" "test" {
location = "%s"
}
resource "azurerm_resource_group" "test2" {
name = "acctestRG2-${var.random}"
location = azurerm_resource_group.test.location
}
resource "azurerm_virtual_network" "test" {
name = "acctestvn-${var.random}"
location = azurerm_resource_group.test.location
Expand Down Expand Up @@ -311,17 +316,17 @@ resource "azurerm_virtual_network_gateway" "test" {
resource "azurerm_local_network_gateway" "test" {
name = "acctest-${var.random}"
location = azurerm_resource_group.test.location
resource_group_name = azurerm_resource_group.test.name
location = azurerm_resource_group.test2.location
resource_group_name = azurerm_resource_group.test2.name
gateway_address = "168.62.225.23"
address_space = ["10.1.1.0/24"]
}
resource "azurerm_virtual_network_gateway_connection" "test" {
name = "acctest-${var.random}"
location = azurerm_resource_group.test.location
resource_group_name = azurerm_resource_group.test.name
location = azurerm_resource_group.test2.location
resource_group_name = azurerm_resource_group.test2.name
type = "IPsec"
virtual_network_gateway_id = azurerm_virtual_network_gateway.test.id
Expand Down

0 comments on commit 6093d95

Please sign in to comment.