AWS CloudFormation
User Guide (API Version 2010-05-15)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Go to the Kindle Store to download this guide in Kindle format.Did this page help you?  Yes | No |  Tell us about it...

AWS::EC2::EIPAssociation

The AWS::EC2::EIPAssociation resource type associates an Elastic IP address with an Amazon EC2 instance. The Elastic IP address can be an existing Elastic IP address or an Elastic IP address allocated through an AWS::EC2::EIP resource.

This type supports updates. For more information about updating stacks, see AWS CloudFormation Stacks Updates.

Syntax

{
   "Type": "AWS::EC2::EIPAssociation",
   "Properties": {
      "AllocationId": String,
      "EIP": String,
      "InstanceId": String,
      "NetworkInterfaceId": String,
      "PrivateIpAddress": String
   }
}

Properties

AllocationId

Allocation ID for the VPC Elastic IP address you want to associate with an Amazon EC2 instance in your VPC.

Required: Conditional. Required for a VPC.

Type: String

Update requires: Replacement if you also change the InstanceId or NetworkInterfaceId property. If not, update requires No interruption.

EIP

Elastic IP address that you want to associate with the Amazon EC2 instance specified by the InstanceId property. You can specify an existing Elastic IP address or a reference to an Elastic IP address allocated with a AWS::EC2::EIP resource.

Required: Conditional. Required for Elastic IP addresses for use in EC2-Classic.

Type: String

Update requires: Replacement if you also change the InstanceId or NetworkInterfaceId property. If not, update requires No interruption.

InstanceId

Instance ID of the Amazon EC2 instance that you want to associate with the Elastic IP address specified by the EIP property.

Required: No

Type: String

Update requires: Replacement if you also change the AllocationId or EIP property. If not, update requires No interruption.

NetworkInterfaceId

The ID of the network interface to associate with the Elastic IP address (VPC only).

Required: No

Type: String

Update requires: Replacement if you also change the AllocationId or EIP property. If not, update requires No interruption.

PrivateIpAddress

The private IP address that you want to associate with the Elastic IP address. The private IP address is restricted to the primary and secondary private IP addresses that are associated with the network interface. By default, the private IP address that is associated with the EIP is the primary private IP address of the network interface.

Required: No

Type: String

Update requires: No interruption

Return Values

Ref

When the logical ID of this resource is provided to the Ref intrinsic function, it returns the resource name.

For more information about using the Ref function, see Ref.

Examples

For AWS::EC2::EIPAssociation snippets, see Assigning an Amazon EC2 Elastic IP Using AWS::EC2::EIP Snippet.