All Products
Search
Document Center

Elastic IP Address:AllocateEipAddress

Last Updated:May 19, 2026

Request an Elastic IP Address (EIP).

Operation description

Before using this API, ensure that you fully understand the billing method and pricing of EIPs. For more information, see Billing overview.

After invoking this API, a randomly selected Elastic IP Address with the status Available will be allocated in the specified region. At the transport layer, EIPs currently support parsing content for ICMP, TCP, and UDP protocols only, and do not support parsing content for protocols such as IGMP and SCTP.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

vpc:AllocateEipAddress

create

*Address

acs:vpc:{#regionId}:{#accountId}:eip/*

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The ID of the region to which the EIP belongs.

You can call the DescribeRegions operation to query the region ID.

Valid values:

  • cn-beijing :

    cn-beijing

cn-hangzhou

Bandwidth

string

No

The maximum bandwidth of the EIP. Unit: Mbit/s.

  • Valid values when InstanceChargeType is set to PostPaid and InternetChargeType is set to PayByBandwidth: 1 to 500.****

  • Valid values when InstanceChargeType is set to PostPaid and InternetChargeType is set to PayByTraffic: 1 to 200.****

  • Valid values when InstanceChargeType is set to PrePaid: 1 to 1000.****

Default value: 5. Unit: Mbit/s.

5

Period

integer

No

The subscription duration of the EIP.

Valid values when PricingCycle is set to Month: 1 to 9.****

Valid values when PricingCycle is set to Year: 1 to 5.****

This parameter must be specified when InstanceChargeType is set to PrePaid. This parameter is optional when InstanceChargeType is set to PostPaid.

1

ISP

string

No

The line type. Valid values:

  • BGP (default): BGP (Multi-ISP) All regions support BGP (Multi-ISP) EIPs.

  • BGP_PRO: BGP (Multi-ISP) Pro Only the following regions support BGP (Multi-ISP) Pro lines: China (Hong Kong), Singapore, Japan (Tokyo), Malaysia (Kuala Lumpur), Philippines (Manila), Indonesia (Jakarta), and Thailand (Bangkok).

For more information about BGP (Multi-ISP) and BGP (Multi-ISP) Pro, see the "Line types" section of What is EIP?

  • If you are allowed to use single-ISP bandwidth, you can also choose one of the following values:

    • ChinaTelecom

    • ChinaUnicom

    • ChinaMobile

    • ChinaTelecom_L2

    • ChinaUnicom_L2

    • ChinaMobile_L2

  • If your services are deployed in China East 1 Finance, this parameter is required and you must set the value to BGP_FinanceCloud.

BGP

ActivityId

integer

No

The promotion code. This parameter is not required.

123456

Netmode

string

No

The network type. Default value: public.

public

AutoPay

boolean

No

Specifies whether to enable automatic payment. Valid values:

  • false (default): The automatic payment is disabled. If you select this option, you must go to the Order Center to complete the payment after an order is generated.

  • true: The automatic payment is enabled. Payments are automatically complete after an order is generated.

If InstanceChargeType is set to PrePaid, this parameter is required. If InstanceChargeType is set to PostPaid, this parameter is not required.

false

PricingCycle

string

No

The billing cycle of the subscription EIP. Valid values:

  • Month (default)

  • Year

If InstanceChargeType is set to PrePaid, this parameter is required. If InstanceChargeType is set to PostPaid, this parameter is not required.

Month

InstanceChargeType

string

No

The billing method of the EIP. Valid values:

  • PrePaid: subscription

  • PostPaid (default): pay-as-you-go

If InstanceChargeType is set to PrePaid, set InternetChargeType to PayByBandwidth. If InstanceChargeType is set to PostPaid, set InternetChargeType to PayByBandwidth or PayByTraffic.

PostPaid

InternetChargeType

string

No

The metering method of the EIP. Valid values:

  • PayByBandwidth (default): pay-by-bandwidth

  • PayByTraffic: pay-by-data-transfer

When InstanceChargeType is set to PrePaid, set InternetChargeType to PayByBandwidth.

When InstanceChargeType is set to PostPaid, set InternetChargeType to PayByBandwidth or PayByTraffic.

PayByTraffic

ResourceGroupId

string

No

The ID of the resource group.

rg-acfmxazffggds****

ClientToken

string

No

The client token that is used to ensure the idempotence of the request.

You can use the client to generate a token, but you must make sure that the token is unique among different requests. The client token can contain only ASCII characters.

Note

If you do not specify this parameter, the system automatically uses the value of RequestId as the client token. The value of RequestId is different for each API request.

0c593ea1-3bea-11e9-b96b-88e9fe637760

Name

string

No

The EIP name.

The name must be 1 to 128 characters in length and start with a letter, and can contain letters, digits, periods (.), underscores (_), and hyphens (-).

Note

You cannot specify this parameter if you create a subscription EIP.

EIP1

Description

string

No

The description of the EIP.

The description must be 2 to 256 characters in length. The description must start with a letter but cannot start with http:// or https://.

Note

You cannot specify this parameter if you create a subscription EIP.

test

SecurityProtectionTypes

array

No

The editions of Anti-DDoS.

  • If you do not specify this parameter, Anti-DDoS Origin Basic is used.

  • If you set the parameter to AntiDDoS_Enhanced, Anti-DDoS Pro/Premium is used.

You can specify up to 10 editions of Anti-DDoS.

AntiDDoS_Enhanced

string

No

The edition of Anti-DDoS.

  • If you do not specify this parameter, Anti-DDoS Origin Basic is used.

  • If you set the parameter to AntiDDoS_Enhanced, Anti-DDoS Pro/Premium is used.

You can specify up to 10 editions of Anti-DDoS.

AntiDDoS_Enhanced

PublicIpAddressPoolId

string

No

The ID of the IP address pool.

The EIP is allocated from the IP address pool.

By default, the IP address pool feature is unavailable. To use the IP address pool, apply for the privilege in the Quota Center console. For more information, see the "Request a quota increase in the Quota Center console" section in Manage EIP quotas.

pippool-2vc0kxcedhquybdsz****

Zone

string

No

The zone of the EIP.

When the service type of the IP address pool specified by PublicIpAddressPoolId is CloudBox, the default value is the zone of the IP address pool.

For more information, see ListPublicIpAddressPools.

ap-southeast-1-lzdvn-cb

IpAddress

string

No

The IP address of the EIP that you want to request.

Specify IpAddress or InstanceId. If you leave both parameters empty, the system randomly allocates an EIP.

192.0.XX.XX

InstanceId

string

No

The EIP ID.

Specify IpAddress or InstanceId. If you leave both parameters empty, the system randomly allocates an EIP.

eip-25877c70gddh****

Tag

array<object>

No

The tags of the resource.

object

No

Key

string

No

The tag key of the resource. You can specify up to 20 tag keys. If you specify this value, it cannot be an empty string.

A tag key can contain up to 128 characters, must not start with aliyun or acs:, and must not contain http:// or https://.

TestKey

Value

string

No

The tag value. When you invoke the API, use the format Tag.N.Value, where N ranges from 1 to 20. If you specify this value, it cannot be an empty string. It can contain up to 128 characters, must not start with aliyun or acs:, and must not contain http:// or https://.

FinanceJoshua

Response elements

Element

Type

Description

Example

object

The response parameters.

RequestId

string

The request ID.

4EC47282-1B74-4534-BD0E-403F3EE64CAF

OrderId

integer

The order ID. This parameter is returned only when InstanceChargeType is set to PrePaid.

10

ResourceGroupId

string

The ID of the resource group. This parameter is returned only when InstanceChargeType is set to PostPaid.

rg-acfmxazfdgdg****

EipAddress

string

The EIP that is allocated. This parameter is returned only when InstanceChargeType is set to PostPaid.

192.0.XX.XX

AllocationId

string

The EIP ID.

eip-25877c70gddh****

Examples

Success response

JSON format

{
  "RequestId": "4EC47282-1B74-4534-BD0E-403F3EE64CAF",
  "OrderId": 10,
  "ResourceGroupId": "rg-acfmxazfdgdg****",
  "EipAddress": "192.0.XX.XX",
  "AllocationId": "eip-25877c70gddh****"
}

Error codes

HTTP status code

Error code

Error message

Description

400 COMMODITY_NO_EXIST commodity is not exist
400 QuotaExceeded.Eip Elastic IP address quota exceeded
400 InvalidParameter Specified value of "InternetChargeType" is not valid
400 InsufficientBalance Your account does not have enough balance.
400 ReserveIpFail Reserve eip failed.
400 InvalidRegion.NotSupport The specified region does not support.
400 InvalidBandwidth.Malformed The specified Bandwidth is invalid.
400 INSTANCE_TYPE_NOT_SUPPORT The instance type is invalid.
400 QueryParameter.Illegal query parameter illegal
400 TokenVerfiy.Failed token verify failed.
400 QuotaExceeded.LargeSpecEip Elastic IP address with large spec quota exceeded.
400 InvalidResourceGroupId The specified ResourceGroupId does not exist. The specified resource group ID does not exist.
400 PAYFOR.CREDIT_PAY_INSUFFICIENT_BALANCE Your account does not have enough balance.
400 SYSTEM.SALE_VALIDATE_UNEXPECTED_ERROR You have arrears and do not meet the purchase conditions.
400 Trade_Sync_Create_Sub_ERROR SyncOrderToSub error.
400 InvalidComponent.EipBandwidthMax The eip_bandwidth_max component is invalid.
400 OperationFailed.RiskControl Risk control check failed. The error message returned because your payment method has security risks. Click the link for verification in your email or console message and submit your order after verification.
400 OperationFailed.SaleValidate Validate sale condition with subArticle failed. Failed to validate the sales condition with a subproject.
400 IllegalParam.OrderParamComponent Product order param has invalid component.
400 OperationFailed.SaleExpression Get the sales expression exception attached to the item.
400 OperationFailed.CompleteUserInfo Complete user info failed.
400 OperationFailed.QueryPrice Query price failed when create order. Failed to query the price when creating the order.
400 OperationFailed.InsufficientEIP Eip resource is not enough.
400 OperationFailed.AccountMoneyInvalid Account money is invalid.
400 OperationFailed.QueryCredtiInfo Failed to query credit info.
400 FrequentPurchase.EIP eip frequent purchase
400 PAY.INSUFFICIENT_BALANCE Your account does not have enough balance. Your account does not have enough balance.
400 PAY.MAYI_WITHHOLDING_AGREEMENT_ILLEGAL User withhoding argeement is illegal.
400 OrderError.EIP FThe Account failed to create order.
400 IellgalParameter.OwnerAccount The specified parameter OwnerAccount is not valid. The specified parameter OwnerAccount is illegal.
400 ResourceNotFound.PublicIpAddressPool The specified resource of PublicIpAddressPool is not found.
400 ResourceNotEnough.PublicIpAddressPool The specified resource of PublicIpAddressPool is not enough.
400 Mismatch.IpAndPublicIpAddressPool The Ip and PublicIpAddressPool are mismatched.
400 CreditPayInsufficientBalance The balance is insufficient, please contact your channel partner to increase the balance The quota is insufficient. Contact your partner to increase the quota.
400 OperationDenied.NotOpenDdosOriginProtectService The operation is not allowed because of you do not open Ddos Origin Protection Service You can not create an anti-DDoS Enhanced EIP because you do not open Ddos Origin Protection Service.
400 IncorrectStatus.PublicIpAddressPool The status of PublicIpAddressPool is incorrect. EIPs are not allowed to be allocated because the address pool is in an unstable state.
400 IllegalParam.Isp The param of %s is illegal. The EIP cannot be allocated because the ISP is invalid.
400 AccountMoneyValidateError The available amount of the account is insufficient. The account does not have sufficient balance.
400 OrderFailed.ConcurrentOperate Failed to create the order due to concurrent operations. Failed to create the order because concurrent operations are performed.
400 OperationFailed.BasicInfoUncompleted Your information is incomplete. Complete your information before the operation.
400 OperationFailed.QuotaNotEnough Your quota is insufficient. Please contact your channel partner to increase your quota
400 ExclusiveParam.ZoneAndPublicIpAddressPoolId The Zone and PublicIpAddressPoolId parameters are mutually exclusive. You cannot specify Zone and PublicIpAddressPoolId at the same time.
400 IllegalParam.Zone The specified zone is invalid. Zone is set to an invalid value.
400 OperationFailed.AllocateUnfamiliarIp The operation failed because only IP addresses used within the last seven days can be allocated. Only IP addresses used within the last seven days can be used to apply for EIP.
400 Ip.Allocated The reserve ip has been allocated. Reserved IP addresses are already specified.
400 IncorrectStatus.Ip The status of ip is incorrect. The status of the IP is incorrect.
400 UnsupportedFeature.AllocateEipAddressWithZone The feature of AllocateEipAddressWithZone is not supported. You are not allowed to create an instance in a specified zone in the region.
400 ResourceNotFound.Ip The specified ip is not found. The specified IP could not be found.
400 OperationFailed.CreditPayInsufficientBalance Your account does not have enough balance. Your account balance is negative. Top up your account before you can make a purchase.
400 OperationFailed.ResourceNotEnough The resources you have applied for are insufficient. The resources you have applied for are insufficient. If you still need to apply, please submit a work order for processing.
400 IllegalParam.Bandwidth The param of bandwidth is illegal. The Bandwidth parameter is set to an invalid value.
400 OperationFailed.IpIsLocked The operation is failed because of ip is locked. Your application failed because the IP address is locked.
400 Mismatch.EipSecurityProtectionTypeAndPoolSecurityProtectionType The EipSecurityProtectionType and PoolSecurityProtectionType are mismatched. The EIP protection type does not match the address pool protection type.
400 IllegalParam.SecurityProtectionTypes The param of securityProtectionTypes is illegal. The passed-in SecurityProtectionTypes parameter is invalid.
400 IllegalParam.ServiceLocation The param of serviceLocation is illegal. The param of serviceLocation is illegal.
400 UnsupportedFeature.Isp The feature of Isp is not supported. The ISP you specified is not currently supported.
400 ExclusiveParam.ZoneAndIpAddress The specified param Zone and IpAddress or InstanceId are mutually exclusive. The specified input zone conflicts with the IpAddress or InstanceId
400 InvalidDescription.Malformed The Description is illeagl. The specified resource description is invalid. The description must be 2 to 256 characters in length and cannot start with http:// or https://.
400 InvalidName.Malformed The attribute name is illegal.
400 OperationFailed.UpgradeCdtServiceFirst The operation is failed because of cdt is not upgraded. The instance type you specified to purchase needs to be upgraded to CDT billing. Upgrade CDT and try again
400 OperationFailed.TokenExpired The operation is failed because of TokenExpired. the specified eip allocation token has expired
500 OrderError.EIP The Account failed to create order.
500 InternalError The request processing has failed due to some unknown error, exception or failure. An internal error occurred.
500 OperationFailed.SystemBusy Operation failed because system is busy.
403 Forbidden User not authorized to operate on the specified resource. You do not have the permissions to manage the specified resource. Apply for the permissions and try again.
404 InvalidRegionId.NotFound Specified value of "RegionId" is not supported.
404 FUWU_BIZ_COMMODITY_VERIFY_FAIL ????????, ????????PD.
409 OperationConflict Request was denied due to conflict with a previous request. The request conflicts with another one. Try again later.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.