# 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

__all__ = [
    'GetSnatEntriesResult',
    'AwaitableGetSnatEntriesResult',
    'get_snat_entries',
]

@pulumi.output_type
class GetSnatEntriesResult:
    """
    A collection of values returned by getSnatEntries.
    """
    def __init__(__self__, entries=None, id=None, ids=None, output_file=None, snat_ip=None, snat_table_id=None, source_cidr=None):
        if entries and not isinstance(entries, list):
            raise TypeError("Expected argument 'entries' to be a list")
        pulumi.set(__self__, "entries", entries)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if ids and not isinstance(ids, list):
            raise TypeError("Expected argument 'ids' to be a list")
        pulumi.set(__self__, "ids", ids)
        if output_file and not isinstance(output_file, str):
            raise TypeError("Expected argument 'output_file' to be a str")
        pulumi.set(__self__, "output_file", output_file)
        if snat_ip and not isinstance(snat_ip, str):
            raise TypeError("Expected argument 'snat_ip' to be a str")
        pulumi.set(__self__, "snat_ip", snat_ip)
        if snat_table_id and not isinstance(snat_table_id, str):
            raise TypeError("Expected argument 'snat_table_id' to be a str")
        pulumi.set(__self__, "snat_table_id", snat_table_id)
        if source_cidr and not isinstance(source_cidr, str):
            raise TypeError("Expected argument 'source_cidr' to be a str")
        pulumi.set(__self__, "source_cidr", source_cidr)

    @property
    @pulumi.getter
    def entries(self) -> List['outputs.GetSnatEntriesEntryResult']:
        """
        A list of Snat Entries. Each element contains the following attributes:
        """
        return pulumi.get(self, "entries")

    @property
    @pulumi.getter
    def id(self) -> str:
        """
        The provider-assigned unique ID for this managed resource.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter
    def ids(self) -> List[str]:
        """
        (Optional) A list of Snat Entries IDs.
        """
        return pulumi.get(self, "ids")

    @property
    @pulumi.getter(name="outputFile")
    def output_file(self) -> Optional[str]:
        return pulumi.get(self, "output_file")

    @property
    @pulumi.getter(name="snatIp")
    def snat_ip(self) -> Optional[str]:
        """
        The public IP of the Snat Entry.
        """
        return pulumi.get(self, "snat_ip")

    @property
    @pulumi.getter(name="snatTableId")
    def snat_table_id(self) -> str:
        return pulumi.get(self, "snat_table_id")

    @property
    @pulumi.getter(name="sourceCidr")
    def source_cidr(self) -> Optional[str]:
        """
        The source CIDR block of the Snat Entry.
        """
        return pulumi.get(self, "source_cidr")


class AwaitableGetSnatEntriesResult(GetSnatEntriesResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetSnatEntriesResult(
            entries=self.entries,
            id=self.id,
            ids=self.ids,
            output_file=self.output_file,
            snat_ip=self.snat_ip,
            snat_table_id=self.snat_table_id,
            source_cidr=self.source_cidr)


def get_snat_entries(ids: Optional[List[str]] = None,
                     output_file: Optional[str] = None,
                     snat_ip: Optional[str] = None,
                     snat_table_id: Optional[str] = None,
                     source_cidr: Optional[str] = None,
                     opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetSnatEntriesResult:
    """
    This data source provides a list of Snat Entries owned by an Alibaba Cloud account.

    > **NOTE:** Available in 1.37.0+.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_alicloud as alicloud

    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "snat-entry-example-name"
    default = alicloud.get_zones(available_resource_creation="VSwitch")
    foo_network = alicloud.vpc.Network("fooNetwork", cidr_block="172.16.0.0/12")
    foo_switch = alicloud.vpc.Switch("fooSwitch",
        availability_zone=default.zones[0].id,
        cidr_block="172.16.0.0/21",
        vpc_id=foo_network.id)
    foo_nat_gateway = alicloud.vpc.NatGateway("fooNatGateway",
        specification="Small",
        vpc_id=foo_network.id)
    foo_eip = alicloud.ecs.Eip("fooEip")
    foo_eip_association = alicloud.ecs.EipAssociation("fooEipAssociation",
        allocation_id=foo_eip.id,
        instance_id=foo_nat_gateway.id)
    foo_snat_entry = alicloud.vpc.SnatEntry("fooSnatEntry",
        snat_ip=foo_eip.ip_address,
        snat_table_id=foo_nat_gateway.snat_table_ids,
        source_vswitch_id=foo_switch.id)
    foo_snat_entries = foo_snat_entry.snat_table_id.apply(lambda snat_table_id: alicloud.vpc.get_snat_entries(snat_table_id=snat_table_id))
    ```


    :param List[str] ids: A list of Snat Entries IDs.
    :param str snat_ip: The public IP of the Snat Entry.
    :param str snat_table_id: The ID of the Snat table.
    :param str source_cidr: The source CIDR block of the Snat Entry.
    """
    __args__ = dict()
    __args__['ids'] = ids
    __args__['outputFile'] = output_file
    __args__['snatIp'] = snat_ip
    __args__['snatTableId'] = snat_table_id
    __args__['sourceCidr'] = source_cidr
    if opts is None:
        opts = pulumi.InvokeOptions()
    if opts.version is None:
        opts.version = _utilities.get_version()
    __ret__ = pulumi.runtime.invoke('alicloud:vpc/getSnatEntries:getSnatEntries', __args__, opts=opts, typ=GetSnatEntriesResult).value

    return AwaitableGetSnatEntriesResult(
        entries=__ret__.entries,
        id=__ret__.id,
        ids=__ret__.ids,
        output_file=__ret__.output_file,
        snat_ip=__ret__.snat_ip,
        snat_table_id=__ret__.snat_table_id,
        source_cidr=__ret__.source_cidr)
