github.com/andresvia/terraform@v0.6.15-0.20160412045437-d51c75946785/website/source/docs/providers/aws/r/eip.html.markdown (about) 1 --- 2 layout: "aws" 3 page_title: "AWS: aws_eip" 4 sidebar_current: "docs-aws-resource-eip" 5 description: |- 6 Provides an Elastic IP resource. 7 --- 8 9 # aws\_eip 10 11 Provides an Elastic IP resource. 12 13 ## Example Usage 14 15 Single EIP associated with an instance: 16 17 ``` 18 resource "aws_eip" "lb" { 19 instance = "${aws_instance.web.id}" 20 vpc = true 21 } 22 ``` 23 24 Muliple EIPs associated with a single network interface: 25 26 ``` 27 resource "aws_network_interface" "multi-ip" { 28 subnet_id = "${aws_subnet.main.id}" 29 private_ips = ["10.0.0.10", "10.0.0.11"] 30 } 31 resource "aws_eip" "one" { 32 vpc = true 33 network_interface = "${aws_network_interface.multi-ip.id}" 34 private_ip = "10.0.0.10" 35 } 36 resource "aws_eip" "two" { 37 vpc = true 38 network_interface = "${aws_network_interface.multi-ip.id}" 39 private_ip = "10.0.0.11" 40 } 41 ``` 42 43 ## Argument Reference 44 45 The following arguments are supported: 46 47 * `vpc` - (Optional) Boolean if the EIP is in a VPC or not. 48 * `instance` - (Optional) EC2 instance ID. 49 * `network_interface` - (Optional) Network interface ID to associate with. 50 * `private_ip` - (Optional) The primary or secondary private IP address to 51 associate with the Elastic IP address. If no private IP address is specified, 52 the Elastic IP address is associated with the primary private IP address. 53 54 ~> **NOTE:** You can specify either the `instance` ID or the `network_interface` ID, 55 but not both. Including both will **not** return an error from the AWS API, but will 56 have undefined behavior. See the relevant [AssociateAddress API Call][1] for 57 more information. 58 59 ## Attributes Reference 60 61 The following attributes are exported: 62 63 * `id` - Contains the EIP allocation ID. 64 * `private_ip` - Contains the private IP address (if in VPC). 65 * `public_ip` - Contains the public IP address. 66 * `instance` - Contains the ID of the attached instance. 67 * `network_interface` - Contains the ID of the attached network interface. 68 69 [1]: https://docs.aws.amazon.com/fr_fr/AWSEC2/latest/APIReference/API_AssociateAddress.html