# 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 builtins
import copy
import warnings
import sys
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
if sys.version_info >= (3, 11):
    from typing import NotRequired, TypedDict, TypeAlias
else:
    from typing_extensions import NotRequired, TypedDict, TypeAlias
from .. import _utilities
from . import outputs

__all__ = [
    'GetSubnetResult',
    'AwaitableGetSubnetResult',
    'get_subnet',
    'get_subnet_output',
]

@pulumi.output_type
class GetSubnetResult:
    """
    A collection of values returned by getSubnet.
    """
    def __init__(__self__, account_id=None, available_ip_address_count=None, cidr_block=None, created_time=None, description=None, enable_ipv6=None, id=None, ipv6_cidr_block=None, is_default=None, network_acl_id=None, project_name=None, read_ipv6_cidr_block=None, route_table=None, status=None, subnet_id=None, subnet_name=None, tags=None, total_ipv4_count=None, updated_time=None, vpc_id=None, zone_id=None):
        if account_id and not isinstance(account_id, str):
            raise TypeError("Expected argument 'account_id' to be a str")
        pulumi.set(__self__, "account_id", account_id)
        if available_ip_address_count and not isinstance(available_ip_address_count, int):
            raise TypeError("Expected argument 'available_ip_address_count' to be a int")
        pulumi.set(__self__, "available_ip_address_count", available_ip_address_count)
        if cidr_block and not isinstance(cidr_block, str):
            raise TypeError("Expected argument 'cidr_block' to be a str")
        pulumi.set(__self__, "cidr_block", cidr_block)
        if created_time and not isinstance(created_time, str):
            raise TypeError("Expected argument 'created_time' to be a str")
        pulumi.set(__self__, "created_time", created_time)
        if description and not isinstance(description, str):
            raise TypeError("Expected argument 'description' to be a str")
        pulumi.set(__self__, "description", description)
        if enable_ipv6 and not isinstance(enable_ipv6, bool):
            raise TypeError("Expected argument 'enable_ipv6' to be a bool")
        pulumi.set(__self__, "enable_ipv6", enable_ipv6)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if ipv6_cidr_block and not isinstance(ipv6_cidr_block, str):
            raise TypeError("Expected argument 'ipv6_cidr_block' to be a str")
        pulumi.set(__self__, "ipv6_cidr_block", ipv6_cidr_block)
        if is_default and not isinstance(is_default, bool):
            raise TypeError("Expected argument 'is_default' to be a bool")
        pulumi.set(__self__, "is_default", is_default)
        if network_acl_id and not isinstance(network_acl_id, str):
            raise TypeError("Expected argument 'network_acl_id' to be a str")
        pulumi.set(__self__, "network_acl_id", network_acl_id)
        if project_name and not isinstance(project_name, str):
            raise TypeError("Expected argument 'project_name' to be a str")
        pulumi.set(__self__, "project_name", project_name)
        if read_ipv6_cidr_block and not isinstance(read_ipv6_cidr_block, str):
            raise TypeError("Expected argument 'read_ipv6_cidr_block' to be a str")
        pulumi.set(__self__, "read_ipv6_cidr_block", read_ipv6_cidr_block)
        if route_table and not isinstance(route_table, dict):
            raise TypeError("Expected argument 'route_table' to be a dict")
        pulumi.set(__self__, "route_table", route_table)
        if status and not isinstance(status, str):
            raise TypeError("Expected argument 'status' to be a str")
        pulumi.set(__self__, "status", status)
        if subnet_id and not isinstance(subnet_id, str):
            raise TypeError("Expected argument 'subnet_id' to be a str")
        pulumi.set(__self__, "subnet_id", subnet_id)
        if subnet_name and not isinstance(subnet_name, str):
            raise TypeError("Expected argument 'subnet_name' to be a str")
        pulumi.set(__self__, "subnet_name", subnet_name)
        if tags and not isinstance(tags, list):
            raise TypeError("Expected argument 'tags' to be a list")
        pulumi.set(__self__, "tags", tags)
        if total_ipv4_count and not isinstance(total_ipv4_count, int):
            raise TypeError("Expected argument 'total_ipv4_count' to be a int")
        pulumi.set(__self__, "total_ipv4_count", total_ipv4_count)
        if updated_time and not isinstance(updated_time, str):
            raise TypeError("Expected argument 'updated_time' to be a str")
        pulumi.set(__self__, "updated_time", updated_time)
        if vpc_id and not isinstance(vpc_id, str):
            raise TypeError("Expected argument 'vpc_id' to be a str")
        pulumi.set(__self__, "vpc_id", vpc_id)
        if zone_id and not isinstance(zone_id, str):
            raise TypeError("Expected argument 'zone_id' to be a str")
        pulumi.set(__self__, "zone_id", zone_id)

    @property
    @pulumi.getter(name="accountId")
    def account_id(self) -> builtins.str:
        """
        子网所属账户的ID。
        """
        return pulumi.get(self, "account_id")

    @property
    @pulumi.getter(name="availableIpAddressCount")
    def available_ip_address_count(self) -> builtins.int:
        """
        子网中可用的IP地址数量。
        """
        return pulumi.get(self, "available_ip_address_count")

    @property
    @pulumi.getter(name="cidrBlock")
    def cidr_block(self) -> builtins.str:
        """
        子网的IPv4网段。
        """
        return pulumi.get(self, "cidr_block")

    @property
    @pulumi.getter(name="createdTime")
    def created_time(self) -> builtins.str:
        """
        子网的创建时间。
        """
        return pulumi.get(self, "created_time")

    @property
    @pulumi.getter
    def description(self) -> builtins.str:
        """
        子网的描述信息。长度限制为0~ 255个字符。需要以字母、中文或数字开头。可包含英文逗号（,）、点号（.）、下划线（_）、空格（ ）、等号（=）、短横线（-）、中文逗号（，）、中文句号（。），不能以http://或https://开头。
        """
        return pulumi.get(self, "description")

    @property
    @pulumi.getter(name="enableIpv6")
    def enable_ipv6(self) -> builtins.bool:
        """
        开启/关闭IPv6功能。仅当子网所属的VPC开通IPv6功能时，可配置此参数。1、true：开启。2、false：关闭。仅当子网内没有分配IPv6地址的云资源时，可配置此取值。
        """
        return pulumi.get(self, "enable_ipv6")

    @property
    @pulumi.getter
    def id(self) -> builtins.str:
        """
        Uniquely identifies the resource.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter(name="ipv6CidrBlock")
    def ipv6_cidr_block(self) -> builtins.str:
        """
        子网IPv6网段。1、创建/修改时请输入子网IPv6网段的最后8比特位（子网的掩码固定为/64）。2、仅当EnableIpv6设置为true时，支持配置本参数。3、取值范围：0～255。掩码固定为/64。
        """
        return pulumi.get(self, "ipv6_cidr_block")

    @property
    @pulumi.getter(name="isDefault")
    def is_default(self) -> builtins.bool:
        """
        该子网是否为默认子网。1、true：默认子网，表示该子网是创建ECS实例时系统自动创建的子网。2、false：非默认子网，表示该子网是用户手动创建的。
        """
        return pulumi.get(self, "is_default")

    @property
    @pulumi.getter(name="networkAclId")
    def network_acl_id(self) -> builtins.str:
        """
        子网关联的网络ACL的ID。
        """
        return pulumi.get(self, "network_acl_id")

    @property
    @pulumi.getter(name="projectName")
    def project_name(self) -> builtins.str:
        """
        子网所在VPC实例所属项目的名称。
        """
        return pulumi.get(self, "project_name")

    @property
    @pulumi.getter(name="readIpv6CidrBlock")
    def read_ipv6_cidr_block(self) -> builtins.str:
        """
        只读字段，子网IPv6网段。
        """
        return pulumi.get(self, "read_ipv6_cidr_block")

    @property
    @pulumi.getter(name="routeTable")
    def route_table(self) -> 'outputs.GetSubnetRouteTableResult':
        """
        路由表信息。
        """
        return pulumi.get(self, "route_table")

    @property
    @pulumi.getter
    def status(self) -> builtins.str:
        """
        子网的状态。1、Pending：表示配置中。2、Available：表示可用。
        """
        return pulumi.get(self, "status")

    @property
    @pulumi.getter(name="subnetId")
    def subnet_id(self) -> builtins.str:
        """
        待修改信息的子网的ID。
        """
        return pulumi.get(self, "subnet_id")

    @property
    @pulumi.getter(name="subnetName")
    def subnet_name(self) -> builtins.str:
        """
        子网的名称，长度限制为1 ~ 128个字符。需要以字母、中文或数字开头，可包含点号（.）、下划线（_）和短横线（-），不能以http://或https://开头，不填默认是子网的ID。
        """
        return pulumi.get(self, "subnet_name")

    @property
    @pulumi.getter
    def tags(self) -> Sequence['outputs.GetSubnetTagResult']:
        """
        子网的标签信息。
        """
        return pulumi.get(self, "tags")

    @property
    @pulumi.getter(name="totalIpv4Count")
    def total_ipv4_count(self) -> builtins.int:
        """
        子网下可用IP总数。
        """
        return pulumi.get(self, "total_ipv4_count")

    @property
    @pulumi.getter(name="updatedTime")
    def updated_time(self) -> builtins.str:
        """
        子网的更新时间。
        """
        return pulumi.get(self, "updated_time")

    @property
    @pulumi.getter(name="vpcId")
    def vpc_id(self) -> builtins.str:
        """
        子网所属VPC的ID。
        """
        return pulumi.get(self, "vpc_id")

    @property
    @pulumi.getter(name="zoneId")
    def zone_id(self) -> builtins.str:
        """
        要创建的子网所属的可用区ID，更多可用区信息请参见地域和可用区。
        """
        return pulumi.get(self, "zone_id")


class AwaitableGetSubnetResult(GetSubnetResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetSubnetResult(
            account_id=self.account_id,
            available_ip_address_count=self.available_ip_address_count,
            cidr_block=self.cidr_block,
            created_time=self.created_time,
            description=self.description,
            enable_ipv6=self.enable_ipv6,
            id=self.id,
            ipv6_cidr_block=self.ipv6_cidr_block,
            is_default=self.is_default,
            network_acl_id=self.network_acl_id,
            project_name=self.project_name,
            read_ipv6_cidr_block=self.read_ipv6_cidr_block,
            route_table=self.route_table,
            status=self.status,
            subnet_id=self.subnet_id,
            subnet_name=self.subnet_name,
            tags=self.tags,
            total_ipv4_count=self.total_ipv4_count,
            updated_time=self.updated_time,
            vpc_id=self.vpc_id,
            zone_id=self.zone_id)


def get_subnet(id: Optional[builtins.str] = None,
               opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetSubnetResult:
    """
    Data Source schema for Byteplus::VPC::Subnet


    :param builtins.str id: Uniquely identifies the resource.
    """
    __args__ = dict()
    __args__['id'] = id
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('bytepluscc:vpc/getSubnet:getSubnet', __args__, opts=opts, typ=GetSubnetResult).value

    return AwaitableGetSubnetResult(
        account_id=pulumi.get(__ret__, 'account_id'),
        available_ip_address_count=pulumi.get(__ret__, 'available_ip_address_count'),
        cidr_block=pulumi.get(__ret__, 'cidr_block'),
        created_time=pulumi.get(__ret__, 'created_time'),
        description=pulumi.get(__ret__, 'description'),
        enable_ipv6=pulumi.get(__ret__, 'enable_ipv6'),
        id=pulumi.get(__ret__, 'id'),
        ipv6_cidr_block=pulumi.get(__ret__, 'ipv6_cidr_block'),
        is_default=pulumi.get(__ret__, 'is_default'),
        network_acl_id=pulumi.get(__ret__, 'network_acl_id'),
        project_name=pulumi.get(__ret__, 'project_name'),
        read_ipv6_cidr_block=pulumi.get(__ret__, 'read_ipv6_cidr_block'),
        route_table=pulumi.get(__ret__, 'route_table'),
        status=pulumi.get(__ret__, 'status'),
        subnet_id=pulumi.get(__ret__, 'subnet_id'),
        subnet_name=pulumi.get(__ret__, 'subnet_name'),
        tags=pulumi.get(__ret__, 'tags'),
        total_ipv4_count=pulumi.get(__ret__, 'total_ipv4_count'),
        updated_time=pulumi.get(__ret__, 'updated_time'),
        vpc_id=pulumi.get(__ret__, 'vpc_id'),
        zone_id=pulumi.get(__ret__, 'zone_id'))
def get_subnet_output(id: Optional[pulumi.Input[builtins.str]] = None,
                      opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetSubnetResult]:
    """
    Data Source schema for Byteplus::VPC::Subnet


    :param builtins.str id: Uniquely identifies the resource.
    """
    __args__ = dict()
    __args__['id'] = id
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('bytepluscc:vpc/getSubnet:getSubnet', __args__, opts=opts, typ=GetSubnetResult)
    return __ret__.apply(lambda __response__: GetSubnetResult(
        account_id=pulumi.get(__response__, 'account_id'),
        available_ip_address_count=pulumi.get(__response__, 'available_ip_address_count'),
        cidr_block=pulumi.get(__response__, 'cidr_block'),
        created_time=pulumi.get(__response__, 'created_time'),
        description=pulumi.get(__response__, 'description'),
        enable_ipv6=pulumi.get(__response__, 'enable_ipv6'),
        id=pulumi.get(__response__, 'id'),
        ipv6_cidr_block=pulumi.get(__response__, 'ipv6_cidr_block'),
        is_default=pulumi.get(__response__, 'is_default'),
        network_acl_id=pulumi.get(__response__, 'network_acl_id'),
        project_name=pulumi.get(__response__, 'project_name'),
        read_ipv6_cidr_block=pulumi.get(__response__, 'read_ipv6_cidr_block'),
        route_table=pulumi.get(__response__, 'route_table'),
        status=pulumi.get(__response__, 'status'),
        subnet_id=pulumi.get(__response__, 'subnet_id'),
        subnet_name=pulumi.get(__response__, 'subnet_name'),
        tags=pulumi.get(__response__, 'tags'),
        total_ipv4_count=pulumi.get(__response__, 'total_ipv4_count'),
        updated_time=pulumi.get(__response__, 'updated_time'),
        vpc_id=pulumi.get(__response__, 'vpc_id'),
        zone_id=pulumi.get(__response__, 'zone_id')))
