# 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 Union
from .. import utilities, tables


class NetworkInterface(pulumi.CustomResource):
    applied_dns_servers: pulumi.Output[list]
    """
    If the Virtual Machine using this Network Interface is part of an Availability Set, then this list will have the union of all DNS servers from all Network Interfaces that are part of the Availability Set.
    """
    dns_servers: pulumi.Output[list]
    """
    A list of IP Addresses defining the DNS Servers which should be used for this Network Interface.
    """
    enable_accelerated_networking: pulumi.Output[bool]
    """
    Should Accelerated Networking be enabled? Defaults to `false`.
    """
    enable_ip_forwarding: pulumi.Output[bool]
    """
    Should IP Forwarding be enabled? Defaults to `false`.
    """
    internal_dns_name_label: pulumi.Output[str]
    """
    The (relative) DNS Name used for internal communications between Virtual Machines in the same Virtual Network.
    """
    internal_domain_name_suffix: pulumi.Output[str]
    """
    Even if `internal_dns_name_label` is not specified, a DNS entry is created for the primary NIC of the VM. This DNS name can be constructed by concatenating the VM name with the value of `internal_domain_name_suffix`.
    """
    ip_configurations: pulumi.Output[list]
    """
    One or more `ip_configuration` blocks as defined below.

      * `name` (`str`) - A name used for this IP Configuration.
      * `primary` (`bool`) - Is this the Primary IP Configuration? Must be `true` for the first `ip_configuration` when multiple are specified. Defaults to `false`.
      * `private_ip_address` (`str`) - The Static IP Address which should be used.
      * `privateIpAddressAllocation` (`str`) - The allocation method used for the Private IP Address. Possible values are `Dynamic` and `Static`.
      * `privateIpAddressVersion` (`str`) - The IP Version to use. Possible values are `IPv4` or `IPv6`. Defaults to `IPv4`.
      * `public_ip_address_id` (`str`) - Reference to a Public IP Address to associate with this NIC
      * `subnet_id` (`str`) - The ID of the Subnet where this Network Interface should be located in.
    """
    location: pulumi.Output[str]
    """
    The location where the Network Interface should exist. Changing this forces a new resource to be created.
    """
    mac_address: pulumi.Output[str]
    """
    The Media Access Control (MAC) Address of the Network Interface.
    """
    name: pulumi.Output[str]
    """
    The name of the Network Interface. Changing this forces a new resource to be created.
    """
    private_ip_address: pulumi.Output[str]
    """
    The Static IP Address which should be used.
    """
    private_ip_addresses: pulumi.Output[list]
    """
    The private IP addresses of the network interface.
    """
    resource_group_name: pulumi.Output[str]
    """
    The name of the Resource Group in which to create the Network Interface. Changing this forces a new resource to be created.
    """
    tags: pulumi.Output[dict]
    """
    A mapping of tags to assign to the resource.
    """
    virtual_machine_id: pulumi.Output[str]
    """
    The ID of the Virtual Machine which this Network Interface is connected to.
    """
    def __init__(__self__, resource_name, opts=None, dns_servers=None, enable_accelerated_networking=None, enable_ip_forwarding=None, internal_dns_name_label=None, ip_configurations=None, location=None, name=None, resource_group_name=None, tags=None, __props__=None, __name__=None, __opts__=None):
        """
        Manages a Network Interface.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_azure as azure

        example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
        example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork",
            address_spaces=["10.0.0.0/16"],
            location=example_resource_group.location,
            resource_group_name=example_resource_group.name)
        example_subnet = azure.network.Subnet("exampleSubnet",
            resource_group_name=example_resource_group.name,
            virtual_network_name=example_virtual_network.name,
            address_prefix="10.0.2.0/24")
        example_network_interface = azure.network.NetworkInterface("exampleNetworkInterface",
            location=example_resource_group.location,
            resource_group_name=example_resource_group.name,
            ip_configurations=[{
                "name": "internal",
                "subnet_id": example_subnet.id,
                "privateIpAddressAllocation": "Dynamic",
            }])
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[list] dns_servers: A list of IP Addresses defining the DNS Servers which should be used for this Network Interface.
        :param pulumi.Input[bool] enable_accelerated_networking: Should Accelerated Networking be enabled? Defaults to `false`.
        :param pulumi.Input[bool] enable_ip_forwarding: Should IP Forwarding be enabled? Defaults to `false`.
        :param pulumi.Input[str] internal_dns_name_label: The (relative) DNS Name used for internal communications between Virtual Machines in the same Virtual Network.
        :param pulumi.Input[list] ip_configurations: One or more `ip_configuration` blocks as defined below.
        :param pulumi.Input[str] location: The location where the Network Interface should exist. Changing this forces a new resource to be created.
        :param pulumi.Input[str] name: The name of the Network Interface. Changing this forces a new resource to be created.
        :param pulumi.Input[str] resource_group_name: The name of the Resource Group in which to create the Network Interface. Changing this forces a new resource to be created.
        :param pulumi.Input[dict] tags: A mapping of tags to assign to the resource.

        The **ip_configurations** object supports the following:

          * `name` (`pulumi.Input[str]`) - A name used for this IP Configuration.
          * `primary` (`pulumi.Input[bool]`) - Is this the Primary IP Configuration? Must be `true` for the first `ip_configuration` when multiple are specified. Defaults to `false`.
          * `private_ip_address` (`pulumi.Input[str]`) - The Static IP Address which should be used.
          * `privateIpAddressAllocation` (`pulumi.Input[str]`) - The allocation method used for the Private IP Address. Possible values are `Dynamic` and `Static`.
          * `privateIpAddressVersion` (`pulumi.Input[str]`) - The IP Version to use. Possible values are `IPv4` or `IPv6`. Defaults to `IPv4`.
          * `public_ip_address_id` (`pulumi.Input[str]`) - Reference to a Public IP Address to associate with this NIC
          * `subnet_id` (`pulumi.Input[str]`) - The ID of the Subnet where this Network Interface should be located in.
        """
        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__['dns_servers'] = dns_servers
            __props__['enable_accelerated_networking'] = enable_accelerated_networking
            __props__['enable_ip_forwarding'] = enable_ip_forwarding
            __props__['internal_dns_name_label'] = internal_dns_name_label
            if ip_configurations is None:
                raise TypeError("Missing required property 'ip_configurations'")
            __props__['ip_configurations'] = ip_configurations
            __props__['location'] = location
            __props__['name'] = name
            if resource_group_name is None:
                raise TypeError("Missing required property 'resource_group_name'")
            __props__['resource_group_name'] = resource_group_name
            __props__['tags'] = tags
            __props__['applied_dns_servers'] = None
            __props__['internal_domain_name_suffix'] = None
            __props__['mac_address'] = None
            __props__['private_ip_address'] = None
            __props__['private_ip_addresses'] = None
            __props__['virtual_machine_id'] = None
        super(NetworkInterface, __self__).__init__(
            'azure:network/networkInterface:NetworkInterface',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name, id, opts=None, applied_dns_servers=None, dns_servers=None, enable_accelerated_networking=None, enable_ip_forwarding=None, internal_dns_name_label=None, internal_domain_name_suffix=None, ip_configurations=None, location=None, mac_address=None, name=None, private_ip_address=None, private_ip_addresses=None, resource_group_name=None, tags=None, virtual_machine_id=None):
        """
        Get an existing NetworkInterface 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 str id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[list] applied_dns_servers: If the Virtual Machine using this Network Interface is part of an Availability Set, then this list will have the union of all DNS servers from all Network Interfaces that are part of the Availability Set.
        :param pulumi.Input[list] dns_servers: A list of IP Addresses defining the DNS Servers which should be used for this Network Interface.
        :param pulumi.Input[bool] enable_accelerated_networking: Should Accelerated Networking be enabled? Defaults to `false`.
        :param pulumi.Input[bool] enable_ip_forwarding: Should IP Forwarding be enabled? Defaults to `false`.
        :param pulumi.Input[str] internal_dns_name_label: The (relative) DNS Name used for internal communications between Virtual Machines in the same Virtual Network.
        :param pulumi.Input[str] internal_domain_name_suffix: Even if `internal_dns_name_label` is not specified, a DNS entry is created for the primary NIC of the VM. This DNS name can be constructed by concatenating the VM name with the value of `internal_domain_name_suffix`.
        :param pulumi.Input[list] ip_configurations: One or more `ip_configuration` blocks as defined below.
        :param pulumi.Input[str] location: The location where the Network Interface should exist. Changing this forces a new resource to be created.
        :param pulumi.Input[str] mac_address: The Media Access Control (MAC) Address of the Network Interface.
        :param pulumi.Input[str] name: The name of the Network Interface. Changing this forces a new resource to be created.
        :param pulumi.Input[str] private_ip_address: The Static IP Address which should be used.
        :param pulumi.Input[list] private_ip_addresses: The private IP addresses of the network interface.
        :param pulumi.Input[str] resource_group_name: The name of the Resource Group in which to create the Network Interface. Changing this forces a new resource to be created.
        :param pulumi.Input[dict] tags: A mapping of tags to assign to the resource.
        :param pulumi.Input[str] virtual_machine_id: The ID of the Virtual Machine which this Network Interface is connected to.

        The **ip_configurations** object supports the following:

          * `name` (`pulumi.Input[str]`) - A name used for this IP Configuration.
          * `primary` (`pulumi.Input[bool]`) - Is this the Primary IP Configuration? Must be `true` for the first `ip_configuration` when multiple are specified. Defaults to `false`.
          * `private_ip_address` (`pulumi.Input[str]`) - The Static IP Address which should be used.
          * `privateIpAddressAllocation` (`pulumi.Input[str]`) - The allocation method used for the Private IP Address. Possible values are `Dynamic` and `Static`.
          * `privateIpAddressVersion` (`pulumi.Input[str]`) - The IP Version to use. Possible values are `IPv4` or `IPv6`. Defaults to `IPv4`.
          * `public_ip_address_id` (`pulumi.Input[str]`) - Reference to a Public IP Address to associate with this NIC
          * `subnet_id` (`pulumi.Input[str]`) - The ID of the Subnet where this Network Interface should be located in.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = dict()

        __props__["applied_dns_servers"] = applied_dns_servers
        __props__["dns_servers"] = dns_servers
        __props__["enable_accelerated_networking"] = enable_accelerated_networking
        __props__["enable_ip_forwarding"] = enable_ip_forwarding
        __props__["internal_dns_name_label"] = internal_dns_name_label
        __props__["internal_domain_name_suffix"] = internal_domain_name_suffix
        __props__["ip_configurations"] = ip_configurations
        __props__["location"] = location
        __props__["mac_address"] = mac_address
        __props__["name"] = name
        __props__["private_ip_address"] = private_ip_address
        __props__["private_ip_addresses"] = private_ip_addresses
        __props__["resource_group_name"] = resource_group_name
        __props__["tags"] = tags
        __props__["virtual_machine_id"] = virtual_machine_id
        return NetworkInterface(resource_name, opts=opts, __props__=__props__)

    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
