AWS Fundamentals Logo
AWS Fundamentals
AWS::EC2::EIPAssociation

EC2 EIPAssociation

Associates an Elastic IP address with an instance or a network interface. Before you can use an Elastic IP address, you must allocate it to your account. For more information about working with Elastic IP addresses, see [Elastic IP address concepts and rules](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-eips.html#vpc-eip-overview). You must specify AllocationId and either InstanceId, NetworkInterfaceId, or PrivateIpAddress.

Properties

5 configurable properties. Click a row to see details.

Filter:
PropertyTypeFlags
AllocationId
string
Create-only
EIP
Any | Any
Create-onlyDeprecated
InstanceId
string
Create-only
NetworkInterfaceId
string
Create-only
PrivateIpAddress
string
Create-only

Return Values

Values returned after the resource is created. Access these with Fn::GetAtt.

AttributeTypeDescription
Idstring-

Sample CloudFormation Template

A minimal template with required properties and common optional ones.

template.yaml
AWSTemplateFormatVersion: "2010-09-09"
Description: Sample template for AWS::EC2::EIPAssociation

Resources:
  MyResource:
    Type: AWS::EC2::EIPAssociation
    Properties:

Required IAM Permissions

Permissions CloudFormation needs in your IAM role to manage this resource.

read

ec2:DescribeAddresses

create

ec2:DescribeAddressesec2:AssociateAddress

list

ec2:DescribeAddresses

delete

ec2:DisassociateAddressec2:DescribeAddresses

Get the EC2 Cheat Sheet

Everything you need to know about EC2 on one page. HD quality, print-friendly.

Download Free Infographic

Quick Facts

ServiceEC2
Properties6
Required0
TaggingNot supported
Primary IDId

Supported Operations

ReadCreateListDelete

Immutable After Creation

These properties cannot be changed after the resource is created. Updating them triggers a replacement.

AllocationIdNetworkInterfaceIdInstanceIdPrivateIpAddressEIP

External Links