awscc_ec2_eip (Resource)

Specifies an Elastic IP (EIP) address and can, optionally, associate it with an Amazon EC2 instance. You can allocate an Elastic IP address from an address pool owned by AWS or from an address pool created from a public IPv4 address range that you have brought to AWS for use with your AWS resources using bring your own IP addresses (BYOIP). For more information, see Bring Your Own IP Addresses (BYOIP) in the Amazon EC2 User Guide. For more information, see Elastic IP Addresses in the Amazon EC2 User Guide.

Example Usage

Allocate an Elastic IP (EIP) address

To use awscc_ec2_eip to allocate an Elastic IP (EIP) address:

resource "awscc_ec2_eip" "main" {
  domain = "vpc"
  tags = [{
    key   = "Managed By"
    value = "AWSCC"
  }]
}

Allocate an Elastic IP (EIP) address and assign it to an Amazon EC2 instance

To use awscc_ec2_eip to allocate an Elastic IP (EIP) address and assign it to an Amazon EC2 instance:

resource "awscc_ec2_eip" "main" {
  domain      = "vpc"
  instance_id = var.instance_id
  tags = [{
    key   = "Managed By"
    value = "AWSCC"
  }]
}

Schema

Optional

Read-Only

Nested Schema for tags

Required:

Import

Import is supported using the following syntax:

$ terraform import awscc_ec2_eip.example <resource ID>