github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/website/source/docs/providers/aws/d/eip.html.markdown (about)

     1  ---
     2  layout: "aws"
     3  page_title: "AWS: aws_eip"
     4  sidebar_current: "docs-aws-datasource-eip"
     5  description: |-
     6      Provides details about a specific Elastic IP
     7  ---
     8  
     9  # aws\_eip
    10  
    11  `aws_eip` provides details about a specific Elastic IP.
    12  
    13  This resource can prove useful when a module accepts an allocation ID or
    14  public IP as an input variable and needs to determine the other.
    15  
    16  ## Example Usage
    17  
    18  The following example shows how one might accept a public IP as a variable
    19  and use this data source to obtain the allocation ID.
    20  
    21  ```hcl
    22  variable "instance_id" {}
    23  variable "public_ip" {}
    24  
    25  data "aws_eip" "proxy_ip" {
    26    public_ip = "${var.public_ip}"
    27  }
    28  
    29  aws_eip_association "proxy_eip" {
    30    instance_id   = "${var.instance_id}"
    31    allocation_id = "${data.aws_eip.proxy_ip.id}"
    32  }
    33  ```
    34  
    35  ## Argument Reference
    36  
    37  The arguments of this data source act as filters for querying the available
    38  Elastic IPs in the current region. The given filters must match exactly one
    39  Elastic IP whose data will be exported as attributes.
    40  
    41  * `id` - (Optional) The allocation id of the specific EIP to retrieve.
    42  
    43  * `public_ip` - (Optional) The public IP of the specific EIP to retrieve.
    44  
    45  ## Attributes Reference
    46  
    47  All of the argument attributes are also exported as result attributes. This
    48  data source will complete the data by populating any fields that are not
    49  included in the configuration with the data for the selected Elastic IP.
    50