We recommend using Azure Native.
azure.network.LocalNetworkGateway
Explore with Pulumi AI
Manages a local network gateway connection over which specific connections can be configured.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.ResourceGroup("example", {
name: "localNetworkGWTest",
location: "West Europe",
});
const home = new azure.network.LocalNetworkGateway("home", {
name: "backHome",
resourceGroupName: example.name,
location: example.location,
gatewayAddress: "12.13.14.15",
addressSpaces: ["10.0.0.0/16"],
});
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
name="localNetworkGWTest",
location="West Europe")
home = azure.network.LocalNetworkGateway("home",
name="backHome",
resource_group_name=example.name,
location=example.location,
gateway_address="12.13.14.15",
address_spaces=["10.0.0.0/16"])
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/network"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
Name: pulumi.String("localNetworkGWTest"),
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
_, err = network.NewLocalNetworkGateway(ctx, "home", &network.LocalNetworkGatewayArgs{
Name: pulumi.String("backHome"),
ResourceGroupName: example.Name,
Location: example.Location,
GatewayAddress: pulumi.String("12.13.14.15"),
AddressSpaces: pulumi.StringArray{
pulumi.String("10.0.0.0/16"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = new Azure.Core.ResourceGroup("example", new()
{
Name = "localNetworkGWTest",
Location = "West Europe",
});
var home = new Azure.Network.LocalNetworkGateway("home", new()
{
Name = "backHome",
ResourceGroupName = example.Name,
Location = example.Location,
GatewayAddress = "12.13.14.15",
AddressSpaces = new[]
{
"10.0.0.0/16",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.network.LocalNetworkGateway;
import com.pulumi.azure.network.LocalNetworkGatewayArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new ResourceGroup("example", ResourceGroupArgs.builder()
.name("localNetworkGWTest")
.location("West Europe")
.build());
var home = new LocalNetworkGateway("home", LocalNetworkGatewayArgs.builder()
.name("backHome")
.resourceGroupName(example.name())
.location(example.location())
.gatewayAddress("12.13.14.15")
.addressSpaces("10.0.0.0/16")
.build());
}
}
resources:
example:
type: azure:core:ResourceGroup
properties:
name: localNetworkGWTest
location: West Europe
home:
type: azure:network:LocalNetworkGateway
properties:
name: backHome
resourceGroupName: ${example.name}
location: ${example.location}
gatewayAddress: 12.13.14.15
addressSpaces:
- 10.0.0.0/16
Create LocalNetworkGateway Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new LocalNetworkGateway(name: string, args: LocalNetworkGatewayArgs, opts?: CustomResourceOptions);
@overload
def LocalNetworkGateway(resource_name: str,
args: LocalNetworkGatewayArgs,
opts: Optional[ResourceOptions] = None)
@overload
def LocalNetworkGateway(resource_name: str,
opts: Optional[ResourceOptions] = None,
resource_group_name: Optional[str] = None,
address_spaces: Optional[Sequence[str]] = None,
bgp_settings: Optional[LocalNetworkGatewayBgpSettingsArgs] = None,
gateway_address: Optional[str] = None,
gateway_fqdn: Optional[str] = None,
location: Optional[str] = None,
name: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None)
func NewLocalNetworkGateway(ctx *Context, name string, args LocalNetworkGatewayArgs, opts ...ResourceOption) (*LocalNetworkGateway, error)
public LocalNetworkGateway(string name, LocalNetworkGatewayArgs args, CustomResourceOptions? opts = null)
public LocalNetworkGateway(String name, LocalNetworkGatewayArgs args)
public LocalNetworkGateway(String name, LocalNetworkGatewayArgs args, CustomResourceOptions options)
type: azure:network:LocalNetworkGateway
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args LocalNetworkGatewayArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args LocalNetworkGatewayArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args LocalNetworkGatewayArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args LocalNetworkGatewayArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args LocalNetworkGatewayArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var localNetworkGatewayResource = new Azure.Network.LocalNetworkGateway("localNetworkGatewayResource", new()
{
ResourceGroupName = "string",
AddressSpaces = new[]
{
"string",
},
BgpSettings = new Azure.Network.Inputs.LocalNetworkGatewayBgpSettingsArgs
{
Asn = 0,
BgpPeeringAddress = "string",
PeerWeight = 0,
},
GatewayAddress = "string",
GatewayFqdn = "string",
Location = "string",
Name = "string",
Tags =
{
{ "string", "string" },
},
});
example, err := network.NewLocalNetworkGateway(ctx, "localNetworkGatewayResource", &network.LocalNetworkGatewayArgs{
ResourceGroupName: pulumi.String("string"),
AddressSpaces: pulumi.StringArray{
pulumi.String("string"),
},
BgpSettings: &network.LocalNetworkGatewayBgpSettingsArgs{
Asn: pulumi.Int(0),
BgpPeeringAddress: pulumi.String("string"),
PeerWeight: pulumi.Int(0),
},
GatewayAddress: pulumi.String("string"),
GatewayFqdn: pulumi.String("string"),
Location: pulumi.String("string"),
Name: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var localNetworkGatewayResource = new LocalNetworkGateway("localNetworkGatewayResource", LocalNetworkGatewayArgs.builder()
.resourceGroupName("string")
.addressSpaces("string")
.bgpSettings(LocalNetworkGatewayBgpSettingsArgs.builder()
.asn(0)
.bgpPeeringAddress("string")
.peerWeight(0)
.build())
.gatewayAddress("string")
.gatewayFqdn("string")
.location("string")
.name("string")
.tags(Map.of("string", "string"))
.build());
local_network_gateway_resource = azure.network.LocalNetworkGateway("localNetworkGatewayResource",
resource_group_name="string",
address_spaces=["string"],
bgp_settings={
"asn": 0,
"bgpPeeringAddress": "string",
"peerWeight": 0,
},
gateway_address="string",
gateway_fqdn="string",
location="string",
name="string",
tags={
"string": "string",
})
const localNetworkGatewayResource = new azure.network.LocalNetworkGateway("localNetworkGatewayResource", {
resourceGroupName: "string",
addressSpaces: ["string"],
bgpSettings: {
asn: 0,
bgpPeeringAddress: "string",
peerWeight: 0,
},
gatewayAddress: "string",
gatewayFqdn: "string",
location: "string",
name: "string",
tags: {
string: "string",
},
});
type: azure:network:LocalNetworkGateway
properties:
addressSpaces:
- string
bgpSettings:
asn: 0
bgpPeeringAddress: string
peerWeight: 0
gatewayAddress: string
gatewayFqdn: string
location: string
name: string
resourceGroupName: string
tags:
string: string
LocalNetworkGateway Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The LocalNetworkGateway resource accepts the following input properties:
- Resource
Group stringName - The name of the resource group in which to create the local network gateway. Changing this forces a new resource to be created.
- Address
Spaces List<string> - The list of string CIDRs representing the address spaces the gateway exposes.
- Bgp
Settings LocalNetwork Gateway Bgp Settings - A
bgp_settings
block as defined below containing the Local Network Gateway's BGP speaker settings. - Gateway
Address string - The gateway IP address to connect with.
- Gateway
Fqdn string The gateway FQDN to connect with.
NOTE: Either
gateway_address
orgateway_fqdn
should be specified.- Location string
- The location/region where the local network gateway is created. Changing this forces a new resource to be created.
- Name string
- The name of the local network gateway. Changing this forces a new resource to be created.
- Dictionary<string, string>
- A mapping of tags to assign to the resource.
- Resource
Group stringName - The name of the resource group in which to create the local network gateway. Changing this forces a new resource to be created.
- Address
Spaces []string - The list of string CIDRs representing the address spaces the gateway exposes.
- Bgp
Settings LocalNetwork Gateway Bgp Settings Args - A
bgp_settings
block as defined below containing the Local Network Gateway's BGP speaker settings. - Gateway
Address string - The gateway IP address to connect with.
- Gateway
Fqdn string The gateway FQDN to connect with.
NOTE: Either
gateway_address
orgateway_fqdn
should be specified.- Location string
- The location/region where the local network gateway is created. Changing this forces a new resource to be created.
- Name string
- The name of the local network gateway. Changing this forces a new resource to be created.
- map[string]string
- A mapping of tags to assign to the resource.
- resource
Group StringName - The name of the resource group in which to create the local network gateway. Changing this forces a new resource to be created.
- address
Spaces List<String> - The list of string CIDRs representing the address spaces the gateway exposes.
- bgp
Settings LocalNetwork Gateway Bgp Settings - A
bgp_settings
block as defined below containing the Local Network Gateway's BGP speaker settings. - gateway
Address String - The gateway IP address to connect with.
- gateway
Fqdn String The gateway FQDN to connect with.
NOTE: Either
gateway_address
orgateway_fqdn
should be specified.- location String
- The location/region where the local network gateway is created. Changing this forces a new resource to be created.
- name String
- The name of the local network gateway. Changing this forces a new resource to be created.
- Map<String,String>
- A mapping of tags to assign to the resource.
- resource
Group stringName - The name of the resource group in which to create the local network gateway. Changing this forces a new resource to be created.
- address
Spaces string[] - The list of string CIDRs representing the address spaces the gateway exposes.
- bgp
Settings LocalNetwork Gateway Bgp Settings - A
bgp_settings
block as defined below containing the Local Network Gateway's BGP speaker settings. - gateway
Address string - The gateway IP address to connect with.
- gateway
Fqdn string The gateway FQDN to connect with.
NOTE: Either
gateway_address
orgateway_fqdn
should be specified.- location string
- The location/region where the local network gateway is created. Changing this forces a new resource to be created.
- name string
- The name of the local network gateway. Changing this forces a new resource to be created.
- {[key: string]: string}
- A mapping of tags to assign to the resource.
- resource_
group_ strname - The name of the resource group in which to create the local network gateway. Changing this forces a new resource to be created.
- address_
spaces Sequence[str] - The list of string CIDRs representing the address spaces the gateway exposes.
- bgp_
settings LocalNetwork Gateway Bgp Settings Args - A
bgp_settings
block as defined below containing the Local Network Gateway's BGP speaker settings. - gateway_
address str - The gateway IP address to connect with.
- gateway_
fqdn str The gateway FQDN to connect with.
NOTE: Either
gateway_address
orgateway_fqdn
should be specified.- location str
- The location/region where the local network gateway is created. Changing this forces a new resource to be created.
- name str
- The name of the local network gateway. Changing this forces a new resource to be created.
- Mapping[str, str]
- A mapping of tags to assign to the resource.
- resource
Group StringName - The name of the resource group in which to create the local network gateway. Changing this forces a new resource to be created.
- address
Spaces List<String> - The list of string CIDRs representing the address spaces the gateway exposes.
- bgp
Settings Property Map - A
bgp_settings
block as defined below containing the Local Network Gateway's BGP speaker settings. - gateway
Address String - The gateway IP address to connect with.
- gateway
Fqdn String The gateway FQDN to connect with.
NOTE: Either
gateway_address
orgateway_fqdn
should be specified.- location String
- The location/region where the local network gateway is created. Changing this forces a new resource to be created.
- name String
- The name of the local network gateway. Changing this forces a new resource to be created.
- Map<String>
- A mapping of tags to assign to the resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the LocalNetworkGateway resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing LocalNetworkGateway Resource
Get an existing LocalNetworkGateway resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: LocalNetworkGatewayState, opts?: CustomResourceOptions): LocalNetworkGateway
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
address_spaces: Optional[Sequence[str]] = None,
bgp_settings: Optional[LocalNetworkGatewayBgpSettingsArgs] = None,
gateway_address: Optional[str] = None,
gateway_fqdn: Optional[str] = None,
location: Optional[str] = None,
name: Optional[str] = None,
resource_group_name: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None) -> LocalNetworkGateway
func GetLocalNetworkGateway(ctx *Context, name string, id IDInput, state *LocalNetworkGatewayState, opts ...ResourceOption) (*LocalNetworkGateway, error)
public static LocalNetworkGateway Get(string name, Input<string> id, LocalNetworkGatewayState? state, CustomResourceOptions? opts = null)
public static LocalNetworkGateway get(String name, Output<String> id, LocalNetworkGatewayState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Address
Spaces List<string> - The list of string CIDRs representing the address spaces the gateway exposes.
- Bgp
Settings LocalNetwork Gateway Bgp Settings - A
bgp_settings
block as defined below containing the Local Network Gateway's BGP speaker settings. - Gateway
Address string - The gateway IP address to connect with.
- Gateway
Fqdn string The gateway FQDN to connect with.
NOTE: Either
gateway_address
orgateway_fqdn
should be specified.- Location string
- The location/region where the local network gateway is created. Changing this forces a new resource to be created.
- Name string
- The name of the local network gateway. Changing this forces a new resource to be created.
- Resource
Group stringName - The name of the resource group in which to create the local network gateway. Changing this forces a new resource to be created.
- Dictionary<string, string>
- A mapping of tags to assign to the resource.
- Address
Spaces []string - The list of string CIDRs representing the address spaces the gateway exposes.
- Bgp
Settings LocalNetwork Gateway Bgp Settings Args - A
bgp_settings
block as defined below containing the Local Network Gateway's BGP speaker settings. - Gateway
Address string - The gateway IP address to connect with.
- Gateway
Fqdn string The gateway FQDN to connect with.
NOTE: Either
gateway_address
orgateway_fqdn
should be specified.- Location string
- The location/region where the local network gateway is created. Changing this forces a new resource to be created.
- Name string
- The name of the local network gateway. Changing this forces a new resource to be created.
- Resource
Group stringName - The name of the resource group in which to create the local network gateway. Changing this forces a new resource to be created.
- map[string]string
- A mapping of tags to assign to the resource.
- address
Spaces List<String> - The list of string CIDRs representing the address spaces the gateway exposes.
- bgp
Settings LocalNetwork Gateway Bgp Settings - A
bgp_settings
block as defined below containing the Local Network Gateway's BGP speaker settings. - gateway
Address String - The gateway IP address to connect with.
- gateway
Fqdn String The gateway FQDN to connect with.
NOTE: Either
gateway_address
orgateway_fqdn
should be specified.- location String
- The location/region where the local network gateway is created. Changing this forces a new resource to be created.
- name String
- The name of the local network gateway. Changing this forces a new resource to be created.
- resource
Group StringName - The name of the resource group in which to create the local network gateway. Changing this forces a new resource to be created.
- Map<String,String>
- A mapping of tags to assign to the resource.
- address
Spaces string[] - The list of string CIDRs representing the address spaces the gateway exposes.
- bgp
Settings LocalNetwork Gateway Bgp Settings - A
bgp_settings
block as defined below containing the Local Network Gateway's BGP speaker settings. - gateway
Address string - The gateway IP address to connect with.
- gateway
Fqdn string The gateway FQDN to connect with.
NOTE: Either
gateway_address
orgateway_fqdn
should be specified.- location string
- The location/region where the local network gateway is created. Changing this forces a new resource to be created.
- name string
- The name of the local network gateway. Changing this forces a new resource to be created.
- resource
Group stringName - The name of the resource group in which to create the local network gateway. Changing this forces a new resource to be created.
- {[key: string]: string}
- A mapping of tags to assign to the resource.
- address_
spaces Sequence[str] - The list of string CIDRs representing the address spaces the gateway exposes.
- bgp_
settings LocalNetwork Gateway Bgp Settings Args - A
bgp_settings
block as defined below containing the Local Network Gateway's BGP speaker settings. - gateway_
address str - The gateway IP address to connect with.
- gateway_
fqdn str The gateway FQDN to connect with.
NOTE: Either
gateway_address
orgateway_fqdn
should be specified.- location str
- The location/region where the local network gateway is created. Changing this forces a new resource to be created.
- name str
- The name of the local network gateway. Changing this forces a new resource to be created.
- resource_
group_ strname - The name of the resource group in which to create the local network gateway. Changing this forces a new resource to be created.
- Mapping[str, str]
- A mapping of tags to assign to the resource.
- address
Spaces List<String> - The list of string CIDRs representing the address spaces the gateway exposes.
- bgp
Settings Property Map - A
bgp_settings
block as defined below containing the Local Network Gateway's BGP speaker settings. - gateway
Address String - The gateway IP address to connect with.
- gateway
Fqdn String The gateway FQDN to connect with.
NOTE: Either
gateway_address
orgateway_fqdn
should be specified.- location String
- The location/region where the local network gateway is created. Changing this forces a new resource to be created.
- name String
- The name of the local network gateway. Changing this forces a new resource to be created.
- resource
Group StringName - The name of the resource group in which to create the local network gateway. Changing this forces a new resource to be created.
- Map<String>
- A mapping of tags to assign to the resource.
Supporting Types
LocalNetworkGatewayBgpSettings, LocalNetworkGatewayBgpSettingsArgs
- Asn int
- The BGP speaker's ASN.
- Bgp
Peering stringAddress - The BGP peering address and BGP identifier of this BGP speaker.
- Peer
Weight int - The weight added to routes learned from this BGP speaker.
- Asn int
- The BGP speaker's ASN.
- Bgp
Peering stringAddress - The BGP peering address and BGP identifier of this BGP speaker.
- Peer
Weight int - The weight added to routes learned from this BGP speaker.
- asn Integer
- The BGP speaker's ASN.
- bgp
Peering StringAddress - The BGP peering address and BGP identifier of this BGP speaker.
- peer
Weight Integer - The weight added to routes learned from this BGP speaker.
- asn number
- The BGP speaker's ASN.
- bgp
Peering stringAddress - The BGP peering address and BGP identifier of this BGP speaker.
- peer
Weight number - The weight added to routes learned from this BGP speaker.
- asn int
- The BGP speaker's ASN.
- bgp_
peering_ straddress - The BGP peering address and BGP identifier of this BGP speaker.
- peer_
weight int - The weight added to routes learned from this BGP speaker.
- asn Number
- The BGP speaker's ASN.
- bgp
Peering StringAddress - The BGP peering address and BGP identifier of this BGP speaker.
- peer
Weight Number - The weight added to routes learned from this BGP speaker.
Import
Local Network Gateways can be imported using the resource id
, e.g.
$ pulumi import azure:network/localNetworkGateway:LocalNetworkGateway lng1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/localNetworkGateways/lng1
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurerm
Terraform Provider.