# 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 json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables

class GetSubnetResult:
    """
    A collection of values returned by getSubnet.
    """
    def __init__(__self__, address_prefix=None, enforce_private_link_service_network_policies=None, ip_configurations=None, name=None, network_security_group_id=None, resource_group_name=None, route_table_id=None, service_endpoints=None, virtual_network_name=None, id=None):
        if address_prefix and not isinstance(address_prefix, str):
            raise TypeError("Expected argument 'address_prefix' to be a str")
        __self__.address_prefix = address_prefix
        """
        The address prefix used for the subnet.
        """
        if enforce_private_link_service_network_policies and not isinstance(enforce_private_link_service_network_policies, bool):
            raise TypeError("Expected argument 'enforce_private_link_service_network_policies' to be a bool")
        __self__.enforce_private_link_service_network_policies = enforce_private_link_service_network_policies
        """
        Enable or Disable network policies on private link service in the subnet.
        """
        if ip_configurations and not isinstance(ip_configurations, list):
            raise TypeError("Expected argument 'ip_configurations' to be a list")
        __self__.ip_configurations = ip_configurations
        """
        The collection of IP Configurations with IPs within this subnet.
        """
        if name and not isinstance(name, str):
            raise TypeError("Expected argument 'name' to be a str")
        __self__.name = name
        if network_security_group_id and not isinstance(network_security_group_id, str):
            raise TypeError("Expected argument 'network_security_group_id' to be a str")
        __self__.network_security_group_id = network_security_group_id
        """
        The ID of the Network Security Group associated with the subnet.
        """
        if resource_group_name and not isinstance(resource_group_name, str):
            raise TypeError("Expected argument 'resource_group_name' to be a str")
        __self__.resource_group_name = resource_group_name
        if route_table_id and not isinstance(route_table_id, str):
            raise TypeError("Expected argument 'route_table_id' to be a str")
        __self__.route_table_id = route_table_id
        """
        The ID of the Route Table associated with this subnet.
        """
        if service_endpoints and not isinstance(service_endpoints, list):
            raise TypeError("Expected argument 'service_endpoints' to be a list")
        __self__.service_endpoints = service_endpoints
        """
        A list of Service Endpoints within this subnet.
        """
        if virtual_network_name and not isinstance(virtual_network_name, str):
            raise TypeError("Expected argument 'virtual_network_name' to be a str")
        __self__.virtual_network_name = virtual_network_name
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        __self__.id = id
        """
        id is the provider-assigned unique ID for this managed resource.
        """
class AwaitableGetSubnetResult(GetSubnetResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetSubnetResult(
            address_prefix=self.address_prefix,
            enforce_private_link_service_network_policies=self.enforce_private_link_service_network_policies,
            ip_configurations=self.ip_configurations,
            name=self.name,
            network_security_group_id=self.network_security_group_id,
            resource_group_name=self.resource_group_name,
            route_table_id=self.route_table_id,
            service_endpoints=self.service_endpoints,
            virtual_network_name=self.virtual_network_name,
            id=self.id)

def get_subnet(name=None,resource_group_name=None,virtual_network_name=None,opts=None):
    """
    Use this data source to access information about an existing Subnet within a Virtual Network.
    
    :param str name: Specifies the name of the Subnet.
    :param str resource_group_name: Specifies the name of the resource group the Virtual Network is located in.
    :param str virtual_network_name: Specifies the name of the Virtual Network this Subnet is located within.

    > This content is derived from https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/website/docs/d/subnet.html.markdown.
    """
    __args__ = dict()

    __args__['name'] = name
    __args__['resourceGroupName'] = resource_group_name
    __args__['virtualNetworkName'] = virtual_network_name
    if opts is None:
        opts = pulumi.InvokeOptions()
    if opts.version is None:
        opts.version = utilities.get_version()
    __ret__ = pulumi.runtime.invoke('azure:network/getSubnet:getSubnet', __args__, opts=opts).value

    return AwaitableGetSubnetResult(
        address_prefix=__ret__.get('addressPrefix'),
        enforce_private_link_service_network_policies=__ret__.get('enforcePrivateLinkServiceNetworkPolicies'),
        ip_configurations=__ret__.get('ipConfigurations'),
        name=__ret__.get('name'),
        network_security_group_id=__ret__.get('networkSecurityGroupId'),
        resource_group_name=__ret__.get('resourceGroupName'),
        route_table_id=__ret__.get('routeTableId'),
        service_endpoints=__ret__.get('serviceEndpoints'),
        virtual_network_name=__ret__.get('virtualNetworkName'),
        id=__ret__.get('id'))
