terraform/website/source/docs/providers/aws/r/eip.html.markdown

46 lines
1.2 KiB
Markdown
Raw Normal View History

2014-07-23 22:08:07 +02:00
---
layout: "aws"
page_title: "AWS: aws_eip"
sidebar_current: "docs-aws-resource-eip"
2014-10-22 05:21:56 +02:00
description: |-
Provides an Elastic IP resource.
2014-07-23 22:08:07 +02:00
---
# aws\_eip
Provides an Elastic IP resource.
## Example Usage
```
resource "aws_eip" "lb" {
2014-07-30 00:12:00 +02:00
instance = "${aws_instance.web.id}"
vpc = true
2014-07-23 22:08:07 +02:00
}
```
## Argument Reference
The following arguments are supported:
2014-07-30 00:12:00 +02:00
* `vpc` - (Optional) Boolean if the EIP is in a VPC or not.
2014-07-23 22:08:07 +02:00
* `instance` - (Optional) EC2 instance ID.
2015-05-05 22:25:45 +02:00
* `network_interface` - (Optional) Network interface ID to associate with.
2014-07-23 22:08:07 +02:00
2016-01-14 21:55:39 +01:00
~> **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
have undefined behavior. See the relevant [AssociateAddress API Call][1] for
more information.
2014-07-23 22:08:07 +02:00
## Attributes Reference
The following attributes are exported:
* `id` - Contains the EIP allocation ID.
* `private_ip` - Contains the private IP address (if in VPC).
2014-07-23 22:08:07 +02:00
* `public_ip` - Contains the public IP address.
* `instance` - Contains the ID of the attached instance.
2015-05-05 22:25:45 +02:00
* `network_interface` - Contains the ID of the attached network interface.
2014-07-23 22:08:07 +02:00
2016-01-14 21:55:39 +01:00
[1]: https://docs.aws.amazon.com/fr_fr/AWSEC2/latest/APIReference/API_AssociateAddress.html