Data Source: aws_eip

aws_eip provides details about a specific Elastic IP.

Example Usage

Search By Allocation ID (VPC only)

data "aws_eip" "by_allocation_id" {
  id = "eipalloc-12345678"
}

Search By Filters (EC2-Classic or VPC)

data "aws_eip" "by_filter" {
  filter {
    name   = "tag:Name"
    values = ["exampleNameTagValue"]
  }
}

Search By Public IP (EC2-Classic or VPC)

data "aws_eip" "by_public_ip" {
  public_ip = "1.2.3.4"
}

Search By Tags (EC2-Classic or VPC)

data "aws_eip" "by_tags" {
  tags = {
    Name = "exampleNameTagValue"
  }
}

Argument Reference

The arguments of this data source act as filters for querying the available Elastic IPs in the current region. The given filters must match exactly one Elastic IP whose data will be exported as attributes.

Attribute Reference

This data source exports the following attributes in addition to the arguments above:

Timeouts

Configuration options: