AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
This is the response object from the AllocateAddress operation.
Namespace: Amazon.EC2.Model
Assembly: AWSSDK.EC2.dll
Version: 3.x.y.z
public class AllocateAddressResponse : AmazonWebServiceResponse
The AllocateAddressResponse type exposes the following members
Name | Description | |
---|---|---|
![]() |
AllocateAddressResponse() |
Name | Type | Description | |
---|---|---|---|
![]() |
AllocationId | System.String |
Gets and sets the property AllocationId. [EC2-VPC] The ID that Amazon Web Services assigns to represent the allocation of the Elastic IP address for use with instances in a VPC. |
![]() |
CarrierIp | System.String |
Gets and sets the property CarrierIp. The carrier IP address. This option is only available for network interfaces which reside in a subnet in a Wavelength Zone (for example an EC2 instance). |
![]() |
ContentLength | System.Int64 | Inherited from Amazon.Runtime.AmazonWebServiceResponse. |
![]() |
CustomerOwnedIp | System.String |
Gets and sets the property CustomerOwnedIp. The customer-owned IP address. |
![]() |
CustomerOwnedIpv4Pool | System.String |
Gets and sets the property CustomerOwnedIpv4Pool. The ID of the customer-owned address pool. |
![]() |
Domain | Amazon.EC2.DomainType |
Gets and sets the property Domain.
Indicates whether the Elastic IP address is for use with instances in a VPC ( |
![]() |
HttpStatusCode | System.Net.HttpStatusCode | Inherited from Amazon.Runtime.AmazonWebServiceResponse. |
![]() |
NetworkBorderGroup | System.String |
Gets and sets the property NetworkBorderGroup. The set of Availability Zones, Local Zones, or Wavelength Zones from which Amazon Web Services advertises IP addresses. |
![]() |
PublicIp | System.String |
Gets and sets the property PublicIp. The Elastic IP address. |
![]() |
PublicIpv4Pool | System.String |
Gets and sets the property PublicIpv4Pool. The ID of an address pool. |
![]() |
ResponseMetadata | Amazon.Runtime.ResponseMetadata | Inherited from Amazon.Runtime.AmazonWebServiceResponse. |
This example allocates an Elastic IP address to use with an instance in a VPC.
var client = new AmazonEC2Client(); var response = client.AllocateAddress(new AllocateAddressRequest { Domain = "vpc" }); string allocationId = response.AllocationId; string domain = response.Domain; string publicIp = response.PublicIp;
This example allocates an Elastic IP address to use with an instance in EC2-Classic.
var client = new AmazonEC2Client(); var response = client.AllocateAddress(new AllocateAddressRequest { }); string domain = response.Domain; string publicIp = response.PublicIp;
.NET Core App:
Supported in: 3.1
.NET Standard:
Supported in: 2.0
.NET Framework:
Supported in: 4.5, 4.0, 3.5