Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, 
      see Getting Started with Amazon Web Services in China
         (PDF). 
    Associate an Elastic IP address with an instance
After you allocate an Elastic IP address, you can associate it with an Amazon resource, 
			such as an EC2 instance, NAT gateway, or Network Load Balancer. To associate an Elastic IP address with
		    a different Amazon resource later on, you can disassociate it from its current resource
		    and then associated it with the new resource.
	  	    Allocate an Elastic IP address
			
			You can allocate an Elastic IP address for use in a Region. There is a charge for all 
				Elastic IP addresses whether they are in use (associated with a resource, like an EC2 instance) 
				or idle (created in your account but unassociated).
	
	  		
	  			- Console
- 
	  					To allocate an Elastic IP address- Open the Amazon EC2 console at
         https://console.amazonaws.cn/ec2/. 
- 
	  							In the navigation pane, choose Network & Security, 
	  								Elastic IPs. 
- 
	  							Choose Allocate Elastic IP address. 
- 
								(Optional) When you allocate an Elastic IP address (EIP), you
									choose the Network border group in which to
									allocate the EIP. A network border group is a collection of
									Availability Zones (AZs), Local Zones, or Wavelength Zones from
									which Amazon advertises a public IP address. Local Zones and
									Wavelength Zones may have different network border groups than
									the AZs in a Region to ensure minimum latency or physical
									distance between the Amazon network and the customers accessing
									the resources in these Zones. You must allocate an EIP in the same network border group
										as the Amazon resource that will be associated with the EIP.
										An EIP in one network border group can only be advertised in
										zones in that network border group and not in any other
										zones represented by other network border groups. 
If you have Local Zones or Wavelength Zones enabled (for more
									information, see Enable a Local Zone or Enable Wavelength Zones), you can choose a network
									border group for AZs, Local Zones, or Wavelength Zones. Choose
									the network border group carefully as the EIP and the Amazon
									resource it is associated with must reside in the same network
									border group. You can use the EC2 console to view the network
									border group that your Availability Zones, Local Zones, or
									Wavelength Zones are in. Typically, all Availability Zones in
									a Region belong to the same network border group, whereas Local
									Zones or Wavelength Zones belong to their own separate network
									border groups. If you don't have Local Zones or Wavelength Zones enabled,
									when you allocate an EIP, the network border group that
									represents all of the AZs for the Region (such as
										us-west-2) is predefined for you and you cannot
									change it. This means that the EIP that you allocate to this
									network border group will be advertised in all AZs in the Region
									you're in.
 
- 
	  							For Public IPv4 address pool, choose one of the
										following: 
	  								 
	  								 
	  								 
									 
	  							- 
	  									Amazon's pool of IPv4 addresses—If you want an IPv4
											address to be allocated from Amazon's pool of IPv4
											addresses. 
- 
	  									Public IPv4 address that you bring to your Amazon
											account—If you want to allocate a
											non-contiguous (non-sequential) public IPv4 address from
											an IP address pool that you have brought to your Amazon
											account. This option is disabled if you do not have any
											IP address pools. For more information about bringing
											your own IP address range to your Amazon account, see
												Bring your own IP addresses (BYOIP) to Amazon EC2. 
- 
	  									Customer owned pool of IPv4 addresses—If you want to
											allocate an IPv4 address from a pool created from your
											on-premises network for use with an Amazon Outpost. This
											option is disabled if you do not have an Amazon
											Outpost. 
- 
										Allocate using an IPAM IPv4 pool: If you want to allocate sequential Elastic IP addresses from a
											contiguous public IPv4 block in an IPAM pool. Allocating sequential
											Elastic IP addresses can significantly reduce management
											overhead for security access control lists and simplify
											IP address allocation and tracking for enterprises
											scaling on Amazon. For more information, see Allocate sequential Elastic IP addresses from an IPAM pool
											in the Amazon VPC IPAM User Guide. 
 
 
- 
	  							(Optional) To add a tag, choose Add new tag 
	  								and enter a tag key and a tag value. 
 
- Amazon CLI
- 
	  					 
	  						To allocate an Elastic IP addressUse the allocate-address 
	  							Amazon CLI command. In the following example, Amazon EC2 selects an address from Amazon's address pool. aws ec2 allocate-address
 In the following example, Amazon EC2 selects an address from the specified
                              pool that you brought to Amazon using BYOIP. aws ec2 allocate-address \
    --public-ipv4-pool ipv4pool-ec2-012345abcdef67890
 The following example specifies an address from the specified IPv4 IPAM pool. aws ec2 allocate-address \
    --ipam-pool-id ipam-pool-1234567890abcdef0\
    --address192.0.2.0
 
- PowerShell
- 
	  					 
	  						To allocate an Elastic IP addressUse the New-EC2Address
	  							cmdlet. In the following example, Amazon EC2 selects an address from Amazon's address pool. New-EC2Address
 In the following example, Amazon EC2 selects an address from the specified
	  						pool that you brought to Amazon using BYOIP. New-EC2Address \
    --PublicIpv4Pool ipv4pool-ec2-012345abcdef67890
 The following example specifies an address from the specified IPv4 IPAM pool. New-EC2Address \
    --IpamPoolId ipam-pool-1234567890abcdef0\
    --Address192.0.2.0
 
Associate an Elastic IP address
	
	        	If you're associating an Elastic IP address with your instance to enable
					communication with the internet, you must also ensure that your instance is in a
					public subnet. For more information, see Enable internet access using an internet gateway in the
						Amazon VPC User Guide.
	  		
	  			- Console
- 
	  					To associate an Elastic IP address with an instance- Open the Amazon EC2 console at
         https://console.amazonaws.cn/ec2/. 
- 
	  							In the navigation pane, choose Elastic IPs.  
- 
	  							Select the Elastic IP address to associate and choose Actions, 
	  								Associate Elastic IP address.  
- 
	  							For Resource type, choose Instance. 
- 
	  							For instance, choose the instance with which to associate the Elastic IP address. You can 
	  								also enter text to search for a specific instance. 
- 
	  							(Optional) For Private IP address, specify a private IP address
										with which to associate the Elastic IP address. 
- 
	  							Choose Associate. 
 
To associate an Elastic IP address with a network interface- Open the Amazon EC2 console at
         https://console.amazonaws.cn/ec2/. 
- 
	  							In the navigation pane, choose Elastic IPs.  
- 
	  							Select the Elastic IP address to associate and choose Actions, 
	  								Associate Elastic IP address.  
- 
	  							For Resource type, choose Network interface. 
- 
	  							For Network interface, choose the network interface with which to associate 
	  								the Elastic IP address. You can also enter text to search for a specific network interface. 
- 
	  							(Optional) For Private IP address, specify a private IP address
										with which to associate the Elastic IP address. 
- 
	  							Choose Associate. 
 
- Amazon CLI
- 
	  					 
	  						To associate an Elastic IP addressUse the associate-address Amazon CLI command. aws ec2 associate-address \
    --instance-id i-0b263919b6498b123\
    --allocation-ideipalloc-64d5890a
 
- PowerShell
- 
	  					 
	  						To associate an Elastic IP addressUse the Register-EC2Address 
	  							cmdlet. Register-EC2Address `
    -InstanceId i-0b263919b6498b123`
    -AllocationIdeipalloc-64d5890a
 
Disassociate an Elastic IP
						address
	
			You can disassociate an Elastic IP address from an instance or network interface at any time. After you disassociate the Elastic IP address, 
				you can associate it with another resource.
			
				- Console
- 
						To disassociate and reassociate an Elastic IP address- Open the Amazon EC2 console at
         https://console.amazonaws.cn/ec2/. 
- 
								In the navigation pane, choose Elastic IPs. 
- 
								Select the Elastic IP address to disassociate, choose Actions, 
									Disassociate Elastic IP address. 
- 
								Choose Disassociate. 
 
- Amazon CLI
- 
						 
							To disassociate an Elastic IP addressUse the disassociate-address Amazon CLI command. aws ec2 disassociate-address --association-id eipassoc-12345678
 
- PowerShell
- 
						 
							To disassociate an Elastic IP addressUse the Unregister-EC2Address 
								cmdlet. Unregister-EC2Address -AssociationId eipassoc-12345678