# 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 GetElasticIpResult:
    """
    A collection of values returned by getElasticIp.
    """
    def __init__(__self__, association_id=None, customer_owned_ip=None, customer_owned_ipv4_pool=None, domain=None, filters=None, id=None, instance_id=None, network_interface_id=None, network_interface_owner_id=None, private_dns=None, private_ip=None, public_dns=None, public_ip=None, public_ipv4_pool=None, tags=None):
        if association_id and not isinstance(association_id, str):
            raise TypeError("Expected argument 'association_id' to be a str")
        __self__.association_id = association_id
        """
        The ID representing the association of the address with an instance in a VPC.
        """
        if customer_owned_ip and not isinstance(customer_owned_ip, str):
            raise TypeError("Expected argument 'customer_owned_ip' to be a str")
        __self__.customer_owned_ip = customer_owned_ip
        """
        Customer Owned IP.
        """
        if customer_owned_ipv4_pool and not isinstance(customer_owned_ipv4_pool, str):
            raise TypeError("Expected argument 'customer_owned_ipv4_pool' to be a str")
        __self__.customer_owned_ipv4_pool = customer_owned_ipv4_pool
        """
        The ID of a Customer Owned IP Pool. For more on customer owned IP addressed check out [Customer-owned IP addresses guide](https://docs.aws.amazon.com/outposts/latest/userguide/outposts-networking-components.html#ip-addressing)
        """
        if domain and not isinstance(domain, str):
            raise TypeError("Expected argument 'domain' to be a str")
        __self__.domain = domain
        """
        Indicates whether the address is for use in EC2-Classic (standard) or in a VPC (vpc).
        """
        if filters and not isinstance(filters, list):
            raise TypeError("Expected argument 'filters' to be a list")
        __self__.filters = filters
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        __self__.id = id
        """
        If VPC Elastic IP, the allocation identifier. If EC2-Classic Elastic IP, the public IP address.
        """
        if instance_id and not isinstance(instance_id, str):
            raise TypeError("Expected argument 'instance_id' to be a str")
        __self__.instance_id = instance_id
        """
        The ID of the instance that the address is associated with (if any).
        """
        if network_interface_id and not isinstance(network_interface_id, str):
            raise TypeError("Expected argument 'network_interface_id' to be a str")
        __self__.network_interface_id = network_interface_id
        """
        The ID of the network interface.
        """
        if network_interface_owner_id and not isinstance(network_interface_owner_id, str):
            raise TypeError("Expected argument 'network_interface_owner_id' to be a str")
        __self__.network_interface_owner_id = network_interface_owner_id
        """
        The ID of the AWS account that owns the network interface.
        """
        if private_dns and not isinstance(private_dns, str):
            raise TypeError("Expected argument 'private_dns' to be a str")
        __self__.private_dns = private_dns
        """
        The Private DNS associated with the Elastic IP address.
        """
        if private_ip and not isinstance(private_ip, str):
            raise TypeError("Expected argument 'private_ip' to be a str")
        __self__.private_ip = private_ip
        """
        The private IP address associated with the Elastic IP address.
        """
        if public_dns and not isinstance(public_dns, str):
            raise TypeError("Expected argument 'public_dns' to be a str")
        __self__.public_dns = public_dns
        """
        Public DNS associated with the Elastic IP address.
        """
        if public_ip and not isinstance(public_ip, str):
            raise TypeError("Expected argument 'public_ip' to be a str")
        __self__.public_ip = public_ip
        """
        Public IP address of Elastic IP.
        """
        if public_ipv4_pool and not isinstance(public_ipv4_pool, str):
            raise TypeError("Expected argument 'public_ipv4_pool' to be a str")
        __self__.public_ipv4_pool = public_ipv4_pool
        """
        The ID of an address pool.
        """
        if tags and not isinstance(tags, dict):
            raise TypeError("Expected argument 'tags' to be a dict")
        __self__.tags = tags
        """
        Key-value map of tags associated with Elastic IP.
        """
class AwaitableGetElasticIpResult(GetElasticIpResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetElasticIpResult(
            association_id=self.association_id,
            customer_owned_ip=self.customer_owned_ip,
            customer_owned_ipv4_pool=self.customer_owned_ipv4_pool,
            domain=self.domain,
            filters=self.filters,
            id=self.id,
            instance_id=self.instance_id,
            network_interface_id=self.network_interface_id,
            network_interface_owner_id=self.network_interface_owner_id,
            private_dns=self.private_dns,
            private_ip=self.private_ip,
            public_dns=self.public_dns,
            public_ip=self.public_ip,
            public_ipv4_pool=self.public_ipv4_pool,
            tags=self.tags)

def get_elastic_ip(filters=None,id=None,public_ip=None,tags=None,opts=None):
    """
    `ec2.Eip` provides details about a specific Elastic IP.

    ## Example Usage

    ### Search By Allocation ID (VPC only)

    ```python
    import pulumi
    import pulumi_aws as aws

    by_allocation_id = aws.get_elastic_ip(id="eipalloc-12345678")
    ```

    ### Search By Filters (EC2-Classic or VPC)

    ```python
    import pulumi
    import pulumi_aws as aws

    by_filter = aws.get_elastic_ip(filters=[{
        "name": "tag:Name",
        "values": ["exampleNameTagValue"],
    }])
    ```

    ### Search By Public IP (EC2-Classic or VPC)

    ```python
    import pulumi
    import pulumi_aws as aws

    by_public_ip = aws.get_elastic_ip(public_ip="1.2.3.4")
    ```

    ### Search By Tags (EC2-Classic or VPC)

    ```python
    import pulumi
    import pulumi_aws as aws

    by_tags = aws.get_elastic_ip(tags={
        "Name": "exampleNameTagValue",
    })
    ```



    :param list filters: One or more name/value pairs to use as filters. There are several valid keys, for a full reference, check out the [EC2 API Reference](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeAddresses.html).
    :param str id: The allocation id of the specific VPC EIP to retrieve. If a classic EIP is required, do NOT set `id`, only set `public_ip`
    :param str public_ip: The public IP of the specific EIP to retrieve.
    :param dict tags: A map of tags, each pair of which must exactly match a pair on the desired Elastic IP

    The **filters** object supports the following:

      * `name` (`str`)
      * `values` (`list`)
    """
    __args__ = dict()


    __args__['filters'] = filters
    __args__['id'] = id
    __args__['publicIp'] = public_ip
    __args__['tags'] = tags
    if opts is None:
        opts = pulumi.InvokeOptions()
    if opts.version is None:
        opts.version = utilities.get_version()
    __ret__ = pulumi.runtime.invoke('aws:index/getElasticIp:getElasticIp', __args__, opts=opts).value

    return AwaitableGetElasticIpResult(
        association_id=__ret__.get('associationId'),
        customer_owned_ip=__ret__.get('customerOwnedIp'),
        customer_owned_ipv4_pool=__ret__.get('customerOwnedIpv4Pool'),
        domain=__ret__.get('domain'),
        filters=__ret__.get('filters'),
        id=__ret__.get('id'),
        instance_id=__ret__.get('instanceId'),
        network_interface_id=__ret__.get('networkInterfaceId'),
        network_interface_owner_id=__ret__.get('networkInterfaceOwnerId'),
        private_dns=__ret__.get('privateDns'),
        private_ip=__ret__.get('privateIp'),
        public_dns=__ret__.get('publicDns'),
        public_ip=__ret__.get('publicIp'),
        public_ipv4_pool=__ret__.get('publicIpv4Pool'),
        tags=__ret__.get('tags'))
