mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-03-23 13:00:40 -04:00
Merge pull request #6070 from hashicorp/phinze/multiple-eips-per-eni
provider/aws: Allow multiple EIPs to associate to single ENI
This commit is contained in:
@@ -12,10 +12,31 @@ Provides an Elastic IP resource.
|
||||
|
||||
## Example Usage
|
||||
|
||||
Single EIP associated with an instance:
|
||||
|
||||
```
|
||||
resource "aws_eip" "lb" {
|
||||
instance = "${aws_instance.web.id}"
|
||||
vpc = true
|
||||
instance = "${aws_instance.web.id}"
|
||||
vpc = true
|
||||
}
|
||||
```
|
||||
|
||||
Muliple EIPs associated with a single network interface:
|
||||
|
||||
```
|
||||
resource "aws_network_interface" "multi-ip" {
|
||||
subnet_id = "${aws_subnet.main.id}"
|
||||
private_ips = ["10.0.0.10", "10.0.0.11"]
|
||||
}
|
||||
resource "aws_eip" "one" {
|
||||
vpc = true
|
||||
network_interface = "${aws_network_interface.multi-ip.id}"
|
||||
private_ip = "10.0.0.10"
|
||||
}
|
||||
resource "aws_eip" "two" {
|
||||
vpc = true
|
||||
network_interface = "${aws_network_interface.multi-ip.id}"
|
||||
private_ip = "10.0.0.11"
|
||||
}
|
||||
```
|
||||
|
||||
@@ -26,6 +47,9 @@ The following arguments are supported:
|
||||
* `vpc` - (Optional) Boolean if the EIP is in a VPC or not.
|
||||
* `instance` - (Optional) EC2 instance ID.
|
||||
* `network_interface` - (Optional) Network interface ID to associate with.
|
||||
* `private_ip` - (Optional) The primary or secondary private IP address to
|
||||
associate with the Elastic IP address. If no private IP address is specified,
|
||||
the Elastic IP address is associated with the primary private IP address.
|
||||
|
||||
~> **NOTE:** You can specify either the `instance` ID or the `network_interface` ID,
|
||||
but not both. Including both will **not** return an error from the AWS API, but will
|
||||
|
||||
Reference in New Issue
Block a user