# 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

__all__ = ['SnatentryArgs', 'Snatentry']

@pulumi.input_type
class SnatentryArgs:
    def __init__(__self__, *,
                 nat_gateway_id: pulumi.Input[builtins.str],
                 eip_id: Optional[pulumi.Input[builtins.str]] = None,
                 nat_ip_id: Optional[pulumi.Input[builtins.str]] = None,
                 snat_entry_name: Optional[pulumi.Input[builtins.str]] = None,
                 source_cidr: Optional[pulumi.Input[builtins.str]] = None,
                 subnet_id: Optional[pulumi.Input[builtins.str]] = None):
        """
        The set of arguments for constructing a Snatentry resource.
        :param pulumi.Input[builtins.str] nat_gateway_id: SNAT规则所属NAT网关的ID。
        :param pulumi.Input[builtins.str] eip_id: SNAT规则关联的公网IP的ID。返回单个公网IP的ID。 返回多个公网IP的ID。
        :param pulumi.Input[builtins.str] nat_ip_id: 私网NAT网关的中转IP的ID。
        :param pulumi.Input[builtins.str] snat_entry_name: SNAT规则的名称。
        :param pulumi.Input[builtins.str] source_cidr: SNAT规则对应的网段。
        :param pulumi.Input[builtins.str] subnet_id: SNAT规则关联子网的ID。
        """
        pulumi.set(__self__, "nat_gateway_id", nat_gateway_id)
        if eip_id is not None:
            pulumi.set(__self__, "eip_id", eip_id)
        if nat_ip_id is not None:
            pulumi.set(__self__, "nat_ip_id", nat_ip_id)
        if snat_entry_name is not None:
            pulumi.set(__self__, "snat_entry_name", snat_entry_name)
        if source_cidr is not None:
            pulumi.set(__self__, "source_cidr", source_cidr)
        if subnet_id is not None:
            pulumi.set(__self__, "subnet_id", subnet_id)

    @property
    @pulumi.getter(name="natGatewayId")
    def nat_gateway_id(self) -> pulumi.Input[builtins.str]:
        """
        SNAT规则所属NAT网关的ID。
        """
        return pulumi.get(self, "nat_gateway_id")

    @nat_gateway_id.setter
    def nat_gateway_id(self, value: pulumi.Input[builtins.str]):
        pulumi.set(self, "nat_gateway_id", value)

    @property
    @pulumi.getter(name="eipId")
    def eip_id(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        SNAT规则关联的公网IP的ID。返回单个公网IP的ID。 返回多个公网IP的ID。
        """
        return pulumi.get(self, "eip_id")

    @eip_id.setter
    def eip_id(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "eip_id", value)

    @property
    @pulumi.getter(name="natIpId")
    def nat_ip_id(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        私网NAT网关的中转IP的ID。
        """
        return pulumi.get(self, "nat_ip_id")

    @nat_ip_id.setter
    def nat_ip_id(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "nat_ip_id", value)

    @property
    @pulumi.getter(name="snatEntryName")
    def snat_entry_name(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        SNAT规则的名称。
        """
        return pulumi.get(self, "snat_entry_name")

    @snat_entry_name.setter
    def snat_entry_name(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "snat_entry_name", value)

    @property
    @pulumi.getter(name="sourceCidr")
    def source_cidr(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        SNAT规则对应的网段。
        """
        return pulumi.get(self, "source_cidr")

    @source_cidr.setter
    def source_cidr(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "source_cidr", value)

    @property
    @pulumi.getter(name="subnetId")
    def subnet_id(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        SNAT规则关联子网的ID。
        """
        return pulumi.get(self, "subnet_id")

    @subnet_id.setter
    def subnet_id(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "subnet_id", value)


@pulumi.input_type
class _SnatentryState:
    def __init__(__self__, *,
                 eip_address: Optional[pulumi.Input[builtins.str]] = None,
                 eip_id: Optional[pulumi.Input[builtins.str]] = None,
                 nat_gateway_id: Optional[pulumi.Input[builtins.str]] = None,
                 nat_ip_id: Optional[pulumi.Input[builtins.str]] = None,
                 snat_entry_id: Optional[pulumi.Input[builtins.str]] = None,
                 snat_entry_name: Optional[pulumi.Input[builtins.str]] = None,
                 source_cidr: Optional[pulumi.Input[builtins.str]] = None,
                 status: Optional[pulumi.Input[builtins.str]] = None,
                 subnet_id: Optional[pulumi.Input[builtins.str]] = None):
        """
        Input properties used for looking up and filtering Snatentry resources.
        :param pulumi.Input[builtins.str] eip_address: SNAT规则关联的公网IP的IP地址。返回单个公网IP的IP地址。 返回多个公网IP的IP地址。
        :param pulumi.Input[builtins.str] eip_id: SNAT规则关联的公网IP的ID。返回单个公网IP的ID。 返回多个公网IP的ID。
        :param pulumi.Input[builtins.str] nat_gateway_id: SNAT规则所属NAT网关的ID。
        :param pulumi.Input[builtins.str] nat_ip_id: 私网NAT网关的中转IP的ID。
        :param pulumi.Input[builtins.str] snat_entry_id: SNAT规则的ID。
        :param pulumi.Input[builtins.str] snat_entry_name: SNAT规则的名称。
        :param pulumi.Input[builtins.str] source_cidr: SNAT规则对应的网段。
        :param pulumi.Input[builtins.str] status: SNAT规则的状态。Creating：创建中。Deleting：删除中。Available：可用。
        :param pulumi.Input[builtins.str] subnet_id: SNAT规则关联子网的ID。
        """
        if eip_address is not None:
            pulumi.set(__self__, "eip_address", eip_address)
        if eip_id is not None:
            pulumi.set(__self__, "eip_id", eip_id)
        if nat_gateway_id is not None:
            pulumi.set(__self__, "nat_gateway_id", nat_gateway_id)
        if nat_ip_id is not None:
            pulumi.set(__self__, "nat_ip_id", nat_ip_id)
        if snat_entry_id is not None:
            pulumi.set(__self__, "snat_entry_id", snat_entry_id)
        if snat_entry_name is not None:
            pulumi.set(__self__, "snat_entry_name", snat_entry_name)
        if source_cidr is not None:
            pulumi.set(__self__, "source_cidr", source_cidr)
        if status is not None:
            pulumi.set(__self__, "status", status)
        if subnet_id is not None:
            pulumi.set(__self__, "subnet_id", subnet_id)

    @property
    @pulumi.getter(name="eipAddress")
    def eip_address(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        SNAT规则关联的公网IP的IP地址。返回单个公网IP的IP地址。 返回多个公网IP的IP地址。
        """
        return pulumi.get(self, "eip_address")

    @eip_address.setter
    def eip_address(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "eip_address", value)

    @property
    @pulumi.getter(name="eipId")
    def eip_id(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        SNAT规则关联的公网IP的ID。返回单个公网IP的ID。 返回多个公网IP的ID。
        """
        return pulumi.get(self, "eip_id")

    @eip_id.setter
    def eip_id(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "eip_id", value)

    @property
    @pulumi.getter(name="natGatewayId")
    def nat_gateway_id(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        SNAT规则所属NAT网关的ID。
        """
        return pulumi.get(self, "nat_gateway_id")

    @nat_gateway_id.setter
    def nat_gateway_id(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "nat_gateway_id", value)

    @property
    @pulumi.getter(name="natIpId")
    def nat_ip_id(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        私网NAT网关的中转IP的ID。
        """
        return pulumi.get(self, "nat_ip_id")

    @nat_ip_id.setter
    def nat_ip_id(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "nat_ip_id", value)

    @property
    @pulumi.getter(name="snatEntryId")
    def snat_entry_id(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        SNAT规则的ID。
        """
        return pulumi.get(self, "snat_entry_id")

    @snat_entry_id.setter
    def snat_entry_id(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "snat_entry_id", value)

    @property
    @pulumi.getter(name="snatEntryName")
    def snat_entry_name(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        SNAT规则的名称。
        """
        return pulumi.get(self, "snat_entry_name")

    @snat_entry_name.setter
    def snat_entry_name(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "snat_entry_name", value)

    @property
    @pulumi.getter(name="sourceCidr")
    def source_cidr(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        SNAT规则对应的网段。
        """
        return pulumi.get(self, "source_cidr")

    @source_cidr.setter
    def source_cidr(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "source_cidr", value)

    @property
    @pulumi.getter
    def status(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        SNAT规则的状态。Creating：创建中。Deleting：删除中。Available：可用。
        """
        return pulumi.get(self, "status")

    @status.setter
    def status(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "status", value)

    @property
    @pulumi.getter(name="subnetId")
    def subnet_id(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        SNAT规则关联子网的ID。
        """
        return pulumi.get(self, "subnet_id")

    @subnet_id.setter
    def subnet_id(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "subnet_id", value)


@pulumi.type_token("bytepluscc:natgateway/snatentry:Snatentry")
class Snatentry(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 eip_id: Optional[pulumi.Input[builtins.str]] = None,
                 nat_gateway_id: Optional[pulumi.Input[builtins.str]] = None,
                 nat_ip_id: Optional[pulumi.Input[builtins.str]] = None,
                 snat_entry_name: Optional[pulumi.Input[builtins.str]] = None,
                 source_cidr: Optional[pulumi.Input[builtins.str]] = None,
                 subnet_id: Optional[pulumi.Input[builtins.str]] = None,
                 __props__=None):
        """
        当私有网络内有多台云服务器实例需要访问公网时，为了节省公网IP且避免在公网上直接暴露云服务器IP，您可以使用公网NAT网关的SNAT规则，安全、便捷、高效地访问公网。SNAT规则支持私有网络、子网、云服务器、自定义网段等四种粒度，您可根据业务需求灵活配置。

        ## Example Usage

        ```python
        import pulumi
        import pulumi_bytepluscc as bytepluscc

        nat_gateway_snatentry_demo = bytepluscc.natgateway.Snatentry("NatGatewaySnatentryDemo",
            nat_gateway_id="ngw-2pc28yhdpbx8g227qo1xxxxx",
            eip_id="eip-iivdtssgbdog74o8cuxxxxx,eip-btbv1pk36g3k5h0b2vxxxxx",
            snat_entry_name="私有网络",
            source_cidr="0.0.0.0/0")
        ```

        ## Import

        ```sh
        $ pulumi import bytepluscc:natgateway/snatentry:Snatentry example "snat_entry_id"
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[builtins.str] eip_id: SNAT规则关联的公网IP的ID。返回单个公网IP的ID。 返回多个公网IP的ID。
        :param pulumi.Input[builtins.str] nat_gateway_id: SNAT规则所属NAT网关的ID。
        :param pulumi.Input[builtins.str] nat_ip_id: 私网NAT网关的中转IP的ID。
        :param pulumi.Input[builtins.str] snat_entry_name: SNAT规则的名称。
        :param pulumi.Input[builtins.str] source_cidr: SNAT规则对应的网段。
        :param pulumi.Input[builtins.str] subnet_id: SNAT规则关联子网的ID。
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: SnatentryArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        当私有网络内有多台云服务器实例需要访问公网时，为了节省公网IP且避免在公网上直接暴露云服务器IP，您可以使用公网NAT网关的SNAT规则，安全、便捷、高效地访问公网。SNAT规则支持私有网络、子网、云服务器、自定义网段等四种粒度，您可根据业务需求灵活配置。

        ## Example Usage

        ```python
        import pulumi
        import pulumi_bytepluscc as bytepluscc

        nat_gateway_snatentry_demo = bytepluscc.natgateway.Snatentry("NatGatewaySnatentryDemo",
            nat_gateway_id="ngw-2pc28yhdpbx8g227qo1xxxxx",
            eip_id="eip-iivdtssgbdog74o8cuxxxxx,eip-btbv1pk36g3k5h0b2vxxxxx",
            snat_entry_name="私有网络",
            source_cidr="0.0.0.0/0")
        ```

        ## Import

        ```sh
        $ pulumi import bytepluscc:natgateway/snatentry:Snatentry example "snat_entry_id"
        ```

        :param str resource_name: The name of the resource.
        :param SnatentryArgs args: The arguments to use to populate this resource's properties.
        :param pulumi.ResourceOptions opts: Options for the resource.
        """
        ...
    def __init__(__self__, resource_name: str, *args, **kwargs):
        resource_args, opts = _utilities.get_resource_args_opts(SnatentryArgs, pulumi.ResourceOptions, *args, **kwargs)
        if resource_args is not None:
            __self__._internal_init(resource_name, opts, **resource_args.__dict__)
        else:
            __self__._internal_init(resource_name, *args, **kwargs)

    def _internal_init(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 eip_id: Optional[pulumi.Input[builtins.str]] = None,
                 nat_gateway_id: Optional[pulumi.Input[builtins.str]] = None,
                 nat_ip_id: Optional[pulumi.Input[builtins.str]] = None,
                 snat_entry_name: Optional[pulumi.Input[builtins.str]] = None,
                 source_cidr: Optional[pulumi.Input[builtins.str]] = None,
                 subnet_id: Optional[pulumi.Input[builtins.str]] = None,
                 __props__=None):
        opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        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__ = SnatentryArgs.__new__(SnatentryArgs)

            __props__.__dict__["eip_id"] = eip_id
            if nat_gateway_id is None and not opts.urn:
                raise TypeError("Missing required property 'nat_gateway_id'")
            __props__.__dict__["nat_gateway_id"] = nat_gateway_id
            __props__.__dict__["nat_ip_id"] = nat_ip_id
            __props__.__dict__["snat_entry_name"] = snat_entry_name
            __props__.__dict__["source_cidr"] = source_cidr
            __props__.__dict__["subnet_id"] = subnet_id
            __props__.__dict__["eip_address"] = None
            __props__.__dict__["snat_entry_id"] = None
            __props__.__dict__["status"] = None
        super(Snatentry, __self__).__init__(
            'bytepluscc:natgateway/snatentry:Snatentry',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            eip_address: Optional[pulumi.Input[builtins.str]] = None,
            eip_id: Optional[pulumi.Input[builtins.str]] = None,
            nat_gateway_id: Optional[pulumi.Input[builtins.str]] = None,
            nat_ip_id: Optional[pulumi.Input[builtins.str]] = None,
            snat_entry_id: Optional[pulumi.Input[builtins.str]] = None,
            snat_entry_name: Optional[pulumi.Input[builtins.str]] = None,
            source_cidr: Optional[pulumi.Input[builtins.str]] = None,
            status: Optional[pulumi.Input[builtins.str]] = None,
            subnet_id: Optional[pulumi.Input[builtins.str]] = None) -> 'Snatentry':
        """
        Get an existing Snatentry 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[builtins.str] eip_address: SNAT规则关联的公网IP的IP地址。返回单个公网IP的IP地址。 返回多个公网IP的IP地址。
        :param pulumi.Input[builtins.str] eip_id: SNAT规则关联的公网IP的ID。返回单个公网IP的ID。 返回多个公网IP的ID。
        :param pulumi.Input[builtins.str] nat_gateway_id: SNAT规则所属NAT网关的ID。
        :param pulumi.Input[builtins.str] nat_ip_id: 私网NAT网关的中转IP的ID。
        :param pulumi.Input[builtins.str] snat_entry_id: SNAT规则的ID。
        :param pulumi.Input[builtins.str] snat_entry_name: SNAT规则的名称。
        :param pulumi.Input[builtins.str] source_cidr: SNAT规则对应的网段。
        :param pulumi.Input[builtins.str] status: SNAT规则的状态。Creating：创建中。Deleting：删除中。Available：可用。
        :param pulumi.Input[builtins.str] subnet_id: SNAT规则关联子网的ID。
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _SnatentryState.__new__(_SnatentryState)

        __props__.__dict__["eip_address"] = eip_address
        __props__.__dict__["eip_id"] = eip_id
        __props__.__dict__["nat_gateway_id"] = nat_gateway_id
        __props__.__dict__["nat_ip_id"] = nat_ip_id
        __props__.__dict__["snat_entry_id"] = snat_entry_id
        __props__.__dict__["snat_entry_name"] = snat_entry_name
        __props__.__dict__["source_cidr"] = source_cidr
        __props__.__dict__["status"] = status
        __props__.__dict__["subnet_id"] = subnet_id
        return Snatentry(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="eipAddress")
    def eip_address(self) -> pulumi.Output[builtins.str]:
        """
        SNAT规则关联的公网IP的IP地址。返回单个公网IP的IP地址。 返回多个公网IP的IP地址。
        """
        return pulumi.get(self, "eip_address")

    @property
    @pulumi.getter(name="eipId")
    def eip_id(self) -> pulumi.Output[builtins.str]:
        """
        SNAT规则关联的公网IP的ID。返回单个公网IP的ID。 返回多个公网IP的ID。
        """
        return pulumi.get(self, "eip_id")

    @property
    @pulumi.getter(name="natGatewayId")
    def nat_gateway_id(self) -> pulumi.Output[builtins.str]:
        """
        SNAT规则所属NAT网关的ID。
        """
        return pulumi.get(self, "nat_gateway_id")

    @property
    @pulumi.getter(name="natIpId")
    def nat_ip_id(self) -> pulumi.Output[builtins.str]:
        """
        私网NAT网关的中转IP的ID。
        """
        return pulumi.get(self, "nat_ip_id")

    @property
    @pulumi.getter(name="snatEntryId")
    def snat_entry_id(self) -> pulumi.Output[builtins.str]:
        """
        SNAT规则的ID。
        """
        return pulumi.get(self, "snat_entry_id")

    @property
    @pulumi.getter(name="snatEntryName")
    def snat_entry_name(self) -> pulumi.Output[builtins.str]:
        """
        SNAT规则的名称。
        """
        return pulumi.get(self, "snat_entry_name")

    @property
    @pulumi.getter(name="sourceCidr")
    def source_cidr(self) -> pulumi.Output[builtins.str]:
        """
        SNAT规则对应的网段。
        """
        return pulumi.get(self, "source_cidr")

    @property
    @pulumi.getter
    def status(self) -> pulumi.Output[builtins.str]:
        """
        SNAT规则的状态。Creating：创建中。Deleting：删除中。Available：可用。
        """
        return pulumi.get(self, "status")

    @property
    @pulumi.getter(name="subnetId")
    def subnet_id(self) -> pulumi.Output[builtins.str]:
        """
        SNAT规则关联子网的ID。
        """
        return pulumi.get(self, "subnet_id")

