# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import warnings
import pulumi
import pulumi.runtime
from typing import Any, Dict, List, Mapping, Optional, Tuple, Union
from .. import _utilities, _tables
from . import outputs
from ._inputs import *

__all__ = ['VirtualNetworkGatewayConnection']


class VirtualNetworkGatewayConnection(pulumi.CustomResource):
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 authorization_key: Optional[pulumi.Input[str]] = None,
                 connection_protocol: Optional[pulumi.Input[str]] = None,
                 enable_bgp: Optional[pulumi.Input[bool]] = None,
                 express_route_circuit_id: Optional[pulumi.Input[str]] = None,
                 express_route_gateway_bypass: Optional[pulumi.Input[bool]] = None,
                 ipsec_policy: Optional[pulumi.Input[pulumi.InputType['VirtualNetworkGatewayConnectionIpsecPolicyArgs']]] = None,
                 local_network_gateway_id: Optional[pulumi.Input[str]] = None,
                 location: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 peer_virtual_network_gateway_id: Optional[pulumi.Input[str]] = None,
                 resource_group_name: Optional[pulumi.Input[str]] = None,
                 routing_weight: Optional[pulumi.Input[float]] = None,
                 shared_key: Optional[pulumi.Input[str]] = None,
                 tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                 traffic_selector_policy: Optional[pulumi.Input[pulumi.InputType['VirtualNetworkGatewayConnectionTrafficSelectorPolicyArgs']]] = None,
                 type: Optional[pulumi.Input[str]] = None,
                 use_policy_based_traffic_selectors: Optional[pulumi.Input[bool]] = None,
                 virtual_network_gateway_id: Optional[pulumi.Input[str]] = None,
                 __props__=None,
                 __name__=None,
                 __opts__=None):
        """
        Manages a connection in an existing Virtual Network Gateway.

        ## Example Usage
        ### Site-to-Site connection

        The following example shows a connection between an Azure virtual network
        and an on-premises VPN device and network.

        ```python
        import pulumi
        import pulumi_azure as azure

        example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West US")
        example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork",
            location=example_resource_group.location,
            resource_group_name=example_resource_group.name,
            address_spaces=["10.0.0.0/16"])
        example_subnet = azure.network.Subnet("exampleSubnet",
            resource_group_name=example_resource_group.name,
            virtual_network_name=example_virtual_network.name,
            address_prefix="10.0.1.0/24")
        onpremise_local_network_gateway = azure.network.LocalNetworkGateway("onpremiseLocalNetworkGateway",
            location=example_resource_group.location,
            resource_group_name=example_resource_group.name,
            gateway_address="168.62.225.23",
            address_spaces=["10.1.1.0/24"])
        example_public_ip = azure.network.PublicIp("examplePublicIp",
            location=example_resource_group.location,
            resource_group_name=example_resource_group.name,
            allocation_method="Dynamic")
        example_virtual_network_gateway = azure.network.VirtualNetworkGateway("exampleVirtualNetworkGateway",
            location=example_resource_group.location,
            resource_group_name=example_resource_group.name,
            type="Vpn",
            vpn_type="RouteBased",
            active_active=False,
            enable_bgp=False,
            sku="Basic",
            ip_configurations=[azure.network.VirtualNetworkGatewayIpConfigurationArgs(
                public_ip_address_id=example_public_ip.id,
                private_ip_address_allocation="Dynamic",
                subnet_id=example_subnet.id,
            )])
        onpremise_virtual_network_gateway_connection = azure.network.VirtualNetworkGatewayConnection("onpremiseVirtualNetworkGatewayConnection",
            location=example_resource_group.location,
            resource_group_name=example_resource_group.name,
            type="IPsec",
            virtual_network_gateway_id=example_virtual_network_gateway.id,
            local_network_gateway_id=onpremise_local_network_gateway.id,
            shared_key="4-v3ry-53cr37-1p53c-5h4r3d-k3y")
        ```
        ### VNet-to-VNet connection

        The following example shows a connection between two Azure virtual network
        in different locations/regions.

        ```python
        import pulumi
        import pulumi_azure as azure

        us_resource_group = azure.core.ResourceGroup("usResourceGroup", location="East US")
        us_virtual_network = azure.network.VirtualNetwork("usVirtualNetwork",
            location=us_resource_group.location,
            resource_group_name=us_resource_group.name,
            address_spaces=["10.0.0.0/16"])
        us_gateway = azure.network.Subnet("usGateway",
            resource_group_name=us_resource_group.name,
            virtual_network_name=us_virtual_network.name,
            address_prefix="10.0.1.0/24")
        us_public_ip = azure.network.PublicIp("usPublicIp",
            location=us_resource_group.location,
            resource_group_name=us_resource_group.name,
            allocation_method="Dynamic")
        us_virtual_network_gateway = azure.network.VirtualNetworkGateway("usVirtualNetworkGateway",
            location=us_resource_group.location,
            resource_group_name=us_resource_group.name,
            type="Vpn",
            vpn_type="RouteBased",
            sku="Basic",
            ip_configurations=[azure.network.VirtualNetworkGatewayIpConfigurationArgs(
                public_ip_address_id=us_public_ip.id,
                private_ip_address_allocation="Dynamic",
                subnet_id=us_gateway.id,
            )])
        europe_resource_group = azure.core.ResourceGroup("europeResourceGroup", location="West Europe")
        europe_virtual_network = azure.network.VirtualNetwork("europeVirtualNetwork",
            location=europe_resource_group.location,
            resource_group_name=europe_resource_group.name,
            address_spaces=["10.1.0.0/16"])
        europe_gateway = azure.network.Subnet("europeGateway",
            resource_group_name=europe_resource_group.name,
            virtual_network_name=europe_virtual_network.name,
            address_prefix="10.1.1.0/24")
        europe_public_ip = azure.network.PublicIp("europePublicIp",
            location=europe_resource_group.location,
            resource_group_name=europe_resource_group.name,
            allocation_method="Dynamic")
        europe_virtual_network_gateway = azure.network.VirtualNetworkGateway("europeVirtualNetworkGateway",
            location=europe_resource_group.location,
            resource_group_name=europe_resource_group.name,
            type="Vpn",
            vpn_type="RouteBased",
            sku="Basic",
            ip_configurations=[azure.network.VirtualNetworkGatewayIpConfigurationArgs(
                public_ip_address_id=europe_public_ip.id,
                private_ip_address_allocation="Dynamic",
                subnet_id=europe_gateway.id,
            )])
        us_to_europe = azure.network.VirtualNetworkGatewayConnection("usToEurope",
            location=us_resource_group.location,
            resource_group_name=us_resource_group.name,
            type="Vnet2Vnet",
            virtual_network_gateway_id=us_virtual_network_gateway.id,
            peer_virtual_network_gateway_id=europe_virtual_network_gateway.id,
            shared_key="4-v3ry-53cr37-1p53c-5h4r3d-k3y")
        europe_to_us = azure.network.VirtualNetworkGatewayConnection("europeToUs",
            location=europe_resource_group.location,
            resource_group_name=europe_resource_group.name,
            type="Vnet2Vnet",
            virtual_network_gateway_id=europe_virtual_network_gateway.id,
            peer_virtual_network_gateway_id=us_virtual_network_gateway.id,
            shared_key="4-v3ry-53cr37-1p53c-5h4r3d-k3y")
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] authorization_key: The authorization key associated with the
               Express Route Circuit. This field is required only if the type is an
               ExpressRoute connection.
        :param pulumi.Input[str] connection_protocol: The IKE protocol version to use. Possible
               values are `IKEv1` and `IKEv2`. Defaults to `IKEv2`.
               Changing this value will force a resource to be created.
               > **Note**: Only valid for `IPSec` connections on virtual network gateways with SKU `VpnGw1`, `VpnGw2`, `VpnGw3`, `VpnGw1AZ`, `VpnGw2AZ` or `VpnGw3AZ`.
        :param pulumi.Input[bool] enable_bgp: If `true`, BGP (Border Gateway Protocol) is enabled
               for this connection. Defaults to `false`.
        :param pulumi.Input[str] express_route_circuit_id: The ID of the Express Route Circuit
               when creating an ExpressRoute connection (i.e. when `type` is `ExpressRoute`).
               The Express Route Circuit can be in the same or in a different subscription.
        :param pulumi.Input[bool] express_route_gateway_bypass: If `true`, data packets will bypass ExpressRoute Gateway for data forwarding This is only valid for ExpressRoute connections.
        :param pulumi.Input[pulumi.InputType['VirtualNetworkGatewayConnectionIpsecPolicyArgs']] ipsec_policy: A `ipsec_policy` block which is documented below.
               Only a single policy can be defined for a connection. For details on
               custom policies refer to [the relevant section in the Azure documentation](https://docs.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-ipsecikepolicy-rm-powershell).
        :param pulumi.Input[str] local_network_gateway_id: The ID of the local network gateway
               when creating Site-to-Site connection (i.e. when `type` is `IPsec`).
        :param pulumi.Input[str] location: The location/region where the connection is
               located. Changing this forces a new resource to be created.
        :param pulumi.Input[str] name: The name of the connection. Changing the name forces a
               new resource to be created.
        :param pulumi.Input[str] peer_virtual_network_gateway_id: The ID of the peer virtual
               network gateway when creating a VNet-to-VNet connection (i.e. when `type`
               is `Vnet2Vnet`). The peer Virtual Network Gateway can be in the same or
               in a different subscription.
        :param pulumi.Input[str] resource_group_name: The name of the resource group in which to
               create the connection Changing the name forces a new resource to be created.
        :param pulumi.Input[float] routing_weight: The routing weight. Defaults to `10`.
        :param pulumi.Input[str] shared_key: The shared IPSec key. A key could be provided if a
               Site-to-Site, VNet-to-VNet or ExpressRoute connection is created.
        :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags: A mapping of tags to assign to the resource.
        :param pulumi.Input[pulumi.InputType['VirtualNetworkGatewayConnectionTrafficSelectorPolicyArgs']] traffic_selector_policy: A `traffic_selector_policy` which allows to specify traffic selector policy proposal to be used in a virtual network gateway connection.
               Only one block can be defined for a connection.
               For details about traffic selectors refer to [the relevant section in the Azure documentation](https://docs.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-connect-multiple-policybased-rm-ps).
        :param pulumi.Input[str] type: The type of connection. Valid options are `IPsec`
               (Site-to-Site), `ExpressRoute` (ExpressRoute), and `Vnet2Vnet` (VNet-to-VNet).
               Each connection type requires different mandatory arguments (refer to the
               examples above). Changing the connection type will force a new connection
               to be created.
        :param pulumi.Input[bool] use_policy_based_traffic_selectors: If `true`, policy-based traffic
               selectors are enabled for this connection. Enabling policy-based traffic
               selectors requires an `ipsec_policy` block. Defaults to `false`.
        :param pulumi.Input[str] virtual_network_gateway_id: The ID of the Virtual Network Gateway
               in which the connection will be created. Changing the gateway forces a new
               resource to be created.
        """
        if __name__ is not None:
            warnings.warn("explicit use of __name__ is deprecated", DeprecationWarning)
            resource_name = __name__
        if __opts__ is not None:
            warnings.warn("explicit use of __opts__ is deprecated, use 'opts' instead", DeprecationWarning)
            opts = __opts__
        if opts is None:
            opts = pulumi.ResourceOptions()
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.version is None:
            opts.version = _utilities.get_version()
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = dict()

            __props__['authorization_key'] = authorization_key
            __props__['connection_protocol'] = connection_protocol
            __props__['enable_bgp'] = enable_bgp
            __props__['express_route_circuit_id'] = express_route_circuit_id
            __props__['express_route_gateway_bypass'] = express_route_gateway_bypass
            __props__['ipsec_policy'] = ipsec_policy
            __props__['local_network_gateway_id'] = local_network_gateway_id
            __props__['location'] = location
            __props__['name'] = name
            __props__['peer_virtual_network_gateway_id'] = peer_virtual_network_gateway_id
            if resource_group_name is None:
                raise TypeError("Missing required property 'resource_group_name'")
            __props__['resource_group_name'] = resource_group_name
            __props__['routing_weight'] = routing_weight
            __props__['shared_key'] = shared_key
            __props__['tags'] = tags
            __props__['traffic_selector_policy'] = traffic_selector_policy
            if type is None:
                raise TypeError("Missing required property 'type'")
            __props__['type'] = type
            __props__['use_policy_based_traffic_selectors'] = use_policy_based_traffic_selectors
            if virtual_network_gateway_id is None:
                raise TypeError("Missing required property 'virtual_network_gateway_id'")
            __props__['virtual_network_gateway_id'] = virtual_network_gateway_id
        super(VirtualNetworkGatewayConnection, __self__).__init__(
            'azure:network/virtualNetworkGatewayConnection:VirtualNetworkGatewayConnection',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            authorization_key: Optional[pulumi.Input[str]] = None,
            connection_protocol: Optional[pulumi.Input[str]] = None,
            enable_bgp: Optional[pulumi.Input[bool]] = None,
            express_route_circuit_id: Optional[pulumi.Input[str]] = None,
            express_route_gateway_bypass: Optional[pulumi.Input[bool]] = None,
            ipsec_policy: Optional[pulumi.Input[pulumi.InputType['VirtualNetworkGatewayConnectionIpsecPolicyArgs']]] = None,
            local_network_gateway_id: Optional[pulumi.Input[str]] = None,
            location: Optional[pulumi.Input[str]] = None,
            name: Optional[pulumi.Input[str]] = None,
            peer_virtual_network_gateway_id: Optional[pulumi.Input[str]] = None,
            resource_group_name: Optional[pulumi.Input[str]] = None,
            routing_weight: Optional[pulumi.Input[float]] = None,
            shared_key: Optional[pulumi.Input[str]] = None,
            tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
            traffic_selector_policy: Optional[pulumi.Input[pulumi.InputType['VirtualNetworkGatewayConnectionTrafficSelectorPolicyArgs']]] = None,
            type: Optional[pulumi.Input[str]] = None,
            use_policy_based_traffic_selectors: Optional[pulumi.Input[bool]] = None,
            virtual_network_gateway_id: Optional[pulumi.Input[str]] = None) -> 'VirtualNetworkGatewayConnection':
        """
        Get an existing VirtualNetworkGatewayConnection resource's state with the given name, id, and optional extra
        properties used to qualify the lookup.

        :param str resource_name: The unique name of the resulting resource.
        :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] authorization_key: The authorization key associated with the
               Express Route Circuit. This field is required only if the type is an
               ExpressRoute connection.
        :param pulumi.Input[str] connection_protocol: The IKE protocol version to use. Possible
               values are `IKEv1` and `IKEv2`. Defaults to `IKEv2`.
               Changing this value will force a resource to be created.
               > **Note**: Only valid for `IPSec` connections on virtual network gateways with SKU `VpnGw1`, `VpnGw2`, `VpnGw3`, `VpnGw1AZ`, `VpnGw2AZ` or `VpnGw3AZ`.
        :param pulumi.Input[bool] enable_bgp: If `true`, BGP (Border Gateway Protocol) is enabled
               for this connection. Defaults to `false`.
        :param pulumi.Input[str] express_route_circuit_id: The ID of the Express Route Circuit
               when creating an ExpressRoute connection (i.e. when `type` is `ExpressRoute`).
               The Express Route Circuit can be in the same or in a different subscription.
        :param pulumi.Input[bool] express_route_gateway_bypass: If `true`, data packets will bypass ExpressRoute Gateway for data forwarding This is only valid for ExpressRoute connections.
        :param pulumi.Input[pulumi.InputType['VirtualNetworkGatewayConnectionIpsecPolicyArgs']] ipsec_policy: A `ipsec_policy` block which is documented below.
               Only a single policy can be defined for a connection. For details on
               custom policies refer to [the relevant section in the Azure documentation](https://docs.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-ipsecikepolicy-rm-powershell).
        :param pulumi.Input[str] local_network_gateway_id: The ID of the local network gateway
               when creating Site-to-Site connection (i.e. when `type` is `IPsec`).
        :param pulumi.Input[str] location: The location/region where the connection is
               located. Changing this forces a new resource to be created.
        :param pulumi.Input[str] name: The name of the connection. Changing the name forces a
               new resource to be created.
        :param pulumi.Input[str] peer_virtual_network_gateway_id: The ID of the peer virtual
               network gateway when creating a VNet-to-VNet connection (i.e. when `type`
               is `Vnet2Vnet`). The peer Virtual Network Gateway can be in the same or
               in a different subscription.
        :param pulumi.Input[str] resource_group_name: The name of the resource group in which to
               create the connection Changing the name forces a new resource to be created.
        :param pulumi.Input[float] routing_weight: The routing weight. Defaults to `10`.
        :param pulumi.Input[str] shared_key: The shared IPSec key. A key could be provided if a
               Site-to-Site, VNet-to-VNet or ExpressRoute connection is created.
        :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags: A mapping of tags to assign to the resource.
        :param pulumi.Input[pulumi.InputType['VirtualNetworkGatewayConnectionTrafficSelectorPolicyArgs']] traffic_selector_policy: A `traffic_selector_policy` which allows to specify traffic selector policy proposal to be used in a virtual network gateway connection.
               Only one block can be defined for a connection.
               For details about traffic selectors refer to [the relevant section in the Azure documentation](https://docs.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-connect-multiple-policybased-rm-ps).
        :param pulumi.Input[str] type: The type of connection. Valid options are `IPsec`
               (Site-to-Site), `ExpressRoute` (ExpressRoute), and `Vnet2Vnet` (VNet-to-VNet).
               Each connection type requires different mandatory arguments (refer to the
               examples above). Changing the connection type will force a new connection
               to be created.
        :param pulumi.Input[bool] use_policy_based_traffic_selectors: If `true`, policy-based traffic
               selectors are enabled for this connection. Enabling policy-based traffic
               selectors requires an `ipsec_policy` block. Defaults to `false`.
        :param pulumi.Input[str] virtual_network_gateway_id: The ID of the Virtual Network Gateway
               in which the connection will be created. Changing the gateway forces a new
               resource to be created.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = dict()

        __props__["authorization_key"] = authorization_key
        __props__["connection_protocol"] = connection_protocol
        __props__["enable_bgp"] = enable_bgp
        __props__["express_route_circuit_id"] = express_route_circuit_id
        __props__["express_route_gateway_bypass"] = express_route_gateway_bypass
        __props__["ipsec_policy"] = ipsec_policy
        __props__["local_network_gateway_id"] = local_network_gateway_id
        __props__["location"] = location
        __props__["name"] = name
        __props__["peer_virtual_network_gateway_id"] = peer_virtual_network_gateway_id
        __props__["resource_group_name"] = resource_group_name
        __props__["routing_weight"] = routing_weight
        __props__["shared_key"] = shared_key
        __props__["tags"] = tags
        __props__["traffic_selector_policy"] = traffic_selector_policy
        __props__["type"] = type
        __props__["use_policy_based_traffic_selectors"] = use_policy_based_traffic_selectors
        __props__["virtual_network_gateway_id"] = virtual_network_gateway_id
        return VirtualNetworkGatewayConnection(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="authorizationKey")
    def authorization_key(self) -> pulumi.Output[Optional[str]]:
        """
        The authorization key associated with the
        Express Route Circuit. This field is required only if the type is an
        ExpressRoute connection.
        """
        return pulumi.get(self, "authorization_key")

    @property
    @pulumi.getter(name="connectionProtocol")
    def connection_protocol(self) -> pulumi.Output[str]:
        """
        The IKE protocol version to use. Possible
        values are `IKEv1` and `IKEv2`. Defaults to `IKEv2`.
        Changing this value will force a resource to be created.
        > **Note**: Only valid for `IPSec` connections on virtual network gateways with SKU `VpnGw1`, `VpnGw2`, `VpnGw3`, `VpnGw1AZ`, `VpnGw2AZ` or `VpnGw3AZ`.
        """
        return pulumi.get(self, "connection_protocol")

    @property
    @pulumi.getter(name="enableBgp")
    def enable_bgp(self) -> pulumi.Output[bool]:
        """
        If `true`, BGP (Border Gateway Protocol) is enabled
        for this connection. Defaults to `false`.
        """
        return pulumi.get(self, "enable_bgp")

    @property
    @pulumi.getter(name="expressRouteCircuitId")
    def express_route_circuit_id(self) -> pulumi.Output[Optional[str]]:
        """
        The ID of the Express Route Circuit
        when creating an ExpressRoute connection (i.e. when `type` is `ExpressRoute`).
        The Express Route Circuit can be in the same or in a different subscription.
        """
        return pulumi.get(self, "express_route_circuit_id")

    @property
    @pulumi.getter(name="expressRouteGatewayBypass")
    def express_route_gateway_bypass(self) -> pulumi.Output[bool]:
        """
        If `true`, data packets will bypass ExpressRoute Gateway for data forwarding This is only valid for ExpressRoute connections.
        """
        return pulumi.get(self, "express_route_gateway_bypass")

    @property
    @pulumi.getter(name="ipsecPolicy")
    def ipsec_policy(self) -> pulumi.Output[Optional['outputs.VirtualNetworkGatewayConnectionIpsecPolicy']]:
        """
        A `ipsec_policy` block which is documented below.
        Only a single policy can be defined for a connection. For details on
        custom policies refer to [the relevant section in the Azure documentation](https://docs.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-ipsecikepolicy-rm-powershell).
        """
        return pulumi.get(self, "ipsec_policy")

    @property
    @pulumi.getter(name="localNetworkGatewayId")
    def local_network_gateway_id(self) -> pulumi.Output[Optional[str]]:
        """
        The ID of the local network gateway
        when creating Site-to-Site connection (i.e. when `type` is `IPsec`).
        """
        return pulumi.get(self, "local_network_gateway_id")

    @property
    @pulumi.getter
    def location(self) -> pulumi.Output[str]:
        """
        The location/region where the connection is
        located. Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "location")

    @property
    @pulumi.getter
    def name(self) -> pulumi.Output[str]:
        """
        The name of the connection. Changing the name forces a
        new resource to be created.
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter(name="peerVirtualNetworkGatewayId")
    def peer_virtual_network_gateway_id(self) -> pulumi.Output[Optional[str]]:
        """
        The ID of the peer virtual
        network gateway when creating a VNet-to-VNet connection (i.e. when `type`
        is `Vnet2Vnet`). The peer Virtual Network Gateway can be in the same or
        in a different subscription.
        """
        return pulumi.get(self, "peer_virtual_network_gateway_id")

    @property
    @pulumi.getter(name="resourceGroupName")
    def resource_group_name(self) -> pulumi.Output[str]:
        """
        The name of the resource group in which to
        create the connection Changing the name forces a new resource to be created.
        """
        return pulumi.get(self, "resource_group_name")

    @property
    @pulumi.getter(name="routingWeight")
    def routing_weight(self) -> pulumi.Output[float]:
        """
        The routing weight. Defaults to `10`.
        """
        return pulumi.get(self, "routing_weight")

    @property
    @pulumi.getter(name="sharedKey")
    def shared_key(self) -> pulumi.Output[Optional[str]]:
        """
        The shared IPSec key. A key could be provided if a
        Site-to-Site, VNet-to-VNet or ExpressRoute connection is created.
        """
        return pulumi.get(self, "shared_key")

    @property
    @pulumi.getter
    def tags(self) -> pulumi.Output[Optional[Mapping[str, str]]]:
        """
        A mapping of tags to assign to the resource.
        """
        return pulumi.get(self, "tags")

    @property
    @pulumi.getter(name="trafficSelectorPolicy")
    def traffic_selector_policy(self) -> pulumi.Output[Optional['outputs.VirtualNetworkGatewayConnectionTrafficSelectorPolicy']]:
        """
        A `traffic_selector_policy` which allows to specify traffic selector policy proposal to be used in a virtual network gateway connection.
        Only one block can be defined for a connection.
        For details about traffic selectors refer to [the relevant section in the Azure documentation](https://docs.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-connect-multiple-policybased-rm-ps).
        """
        return pulumi.get(self, "traffic_selector_policy")

    @property
    @pulumi.getter
    def type(self) -> pulumi.Output[str]:
        """
        The type of connection. Valid options are `IPsec`
        (Site-to-Site), `ExpressRoute` (ExpressRoute), and `Vnet2Vnet` (VNet-to-VNet).
        Each connection type requires different mandatory arguments (refer to the
        examples above). Changing the connection type will force a new connection
        to be created.
        """
        return pulumi.get(self, "type")

    @property
    @pulumi.getter(name="usePolicyBasedTrafficSelectors")
    def use_policy_based_traffic_selectors(self) -> pulumi.Output[bool]:
        """
        If `true`, policy-based traffic
        selectors are enabled for this connection. Enabling policy-based traffic
        selectors requires an `ipsec_policy` block. Defaults to `false`.
        """
        return pulumi.get(self, "use_policy_based_traffic_selectors")

    @property
    @pulumi.getter(name="virtualNetworkGatewayId")
    def virtual_network_gateway_id(self) -> pulumi.Output[str]:
        """
        The ID of the Virtual Network Gateway
        in which the connection will be created. Changing the gateway forces a new
        resource to be created.
        """
        return pulumi.get(self, "virtual_network_gateway_id")

    def translate_output_property(self, prop):
        return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop

    def translate_input_property(self, prop):
        return _tables.SNAKE_TO_CAMEL_CASE_TABLE.get(prop) or prop

