ALIYUN::VPC::EIP is used to apply for an elastic IP address (EIP).

Syntax

{
  "Type": "ALIYUN::VPC::EIP",
  "Properties": {
    "DeletionProtection": Boolean,
    "Name": String,
    "Tags": List,
    "Isp": String,
    "Netmode": String,
    "Period": Number,
    "ResourceGroupId": String,
    "AutoPay": Boolean,
    "InstanceChargeType": String,
    "PricingCycle": String,
    "Bandwidth": Number,
    "InternetChargeType": String,
    "Description": String,
    "SecurityProtectionTypes": List,
    "PublicIpAddressPoolId": String
  }
}

Properties

Property Type Required Editable Description Constraint
DeletionProtection Boolean No No Specifies whether to enable the deletion protection feature. Default value: false. Valid values:
  • true: enables the deletion protection feature.
  • false: does not enable the deletion protection feature.
Name String No Yes The name of the EIP. The name must be 2 to 128 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter but cannot start with http:// or https://.
ResourceGroupId String No Yes The ID of the resource group. None.
Netmode String No No The network type. Set the value to public, which indicates the Internet.
Bandwidth Number No Yes The bandwidth of the EIP. Unit: Mbit/s. Default value: 5. If you do not specify this property, the default value is used.
InternetChargeType String No No The metering method of the EIP. Default value: PayByBandwidth. Valid values:
  • PayByBandwidth
  • PayByTraffic
InstanceChargeType String No No The billing method of the EIP. Default value: Postpaid. Valid values:
  • Prepaid
  • Postpaid
PricingCycle String No No The billing cycle of the EIP to which you are subscribed. Default value: Month. Valid values:
  • Month
  • Year
Note PricingCycle is required if InstanceChargeType is set to Prepaid.
Period Number No No The subscription duration.
  • Valid values if PricingCycle is set to Month: 1 to 9.
  • Valid values if PricingCycle is set to Year: 1 to 3.

Default value: 1.

Note Period is required if InstanceChargeType is set to Prepaid.
AutoPay Boolean No No Specifies whether to enable automatic payment. Default value: true. Valid values:
  • false: does not enable automatic payment. After an order is generated, you must go to the order center to complete the payment. For more information about the order center, go to the Orders page of the Billing Management console.
  • true: enables automatic payment. After an order is generated, the system automatically completes the payment.
Note This property is required if the InstanceChargeType property is set to Prepaid.
Isp String No No The line type.

Default value: BGP. Valid values:

  • BGP: BGP (Multi-ISP) lines
  • BGP_PRO: BGP (Multi-ISP) Pro lines

BGP (Multi-ISP) lines are supported in all regions. BGP (Multi-ISP) Pro lines are supported only in the China (Hong Kong) region.

Description String No Yes 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://.
Tags List No Yes The tags of the EIP. Up to 20 tags can be specified. Each tag is a key-value pair. You can leave the tag value empty.

For more information, see Tags syntax and Tags properties.

SecurityProtectionTypes List No No The editions of Anti-DDoS. Valid values:
  • Null: If you set this property to Null, Anti-DDoS Origin is used by default.
  • AntiDDoS_Enhanced: If you set this property to AntiDDoS_Enhanced, Anti-DDoS Pro or Premium is used.
Note You can configure up to 10 editions of Anti-DDoS.
PublicIpAddressPoolId String No No The ID of the IP address pool. EIPs are allocated from the specified IP address pool. The IP address pool feature is available only to users whose accounts are granted the required permissions for trial use. To use the feature, submit a ticket.

Tags syntax

"Tags": [
  {
    "Key": String,
    "Value": String
  }
]  

Tags properties

Property Type Required Editable Description Constraint
Key String Yes No The key of the tag. The key must be 1 to 128 characters in length and cannot contain http:// or https://. It cannot start with acs: or aliyun.
Value String No No The value of the tag. The value must be 0 to 128 characters in length and cannot contain http:// or https://. It cannot start with acs: or aliyun.

Return values

Fn::GetAtt

  • EipAddress: the allocated EIP.
  • AllocationId: the ID of the instance to which the EIP is allocated.
  • OrderId: the order ID, which is returned only when InstanceChargeType is set to Prepaid.
  • Isp: the line type.

Examples

  • YAML format

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters: {}
    Resources:
      ElasticIp:
        Type: ALIYUN::VPC::EIP
        Properties:
          InstanceChargeType: Postpaid
          Name: TestEIP
          InternetChargeType: PayByBandwidth
          Netmode: public
          Bandwidth: 5
    Outputs:
      Isp:
        Description: The line type.
        Value:
          Fn::GetAtt:
            - ElasticIp
            - Isp
      AllocationId:
        Description: ID that Aliyun assigns to represent the allocation of the address for use with VPC. Returned only for VPC elastic IP addresses.
        Value:
          Fn::GetAtt:
            - ElasticIp
            - AllocationId
      EipAddress:
        Description: IP address of created EIP.
        Value:
          Fn::GetAtt:
            - ElasticIp
            - EipAddress
      OrderId:
        Description: Order ID of prepaid EIP instance.
        Value:
          Fn::GetAtt:
            - ElasticIp
            - OrderId
  • JSON format

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
      },
      "Resources": {
        "ElasticIp": {
          "Type": "ALIYUN::VPC::EIP",
          "Properties": {
            "InstanceChargeType": "Postpaid",
            "Name": "TestEIP",
            "InternetChargeType": "PayByBandwidth",
            "Netmode": "public",
            "Bandwidth": 5
          }
        }
      },
      "Outputs": {
        "Isp": {
          "Description": "The line type.",
          "Value": {
            "Fn::GetAtt": [
              "ElasticIp",
              "Isp"
            ]
          }
        },
        "AllocationId": {
          "Description": "ID that Aliyun assigns to represent the allocation of the address for use with VPC. Returned only for VPC elastic IP addresses.",
          "Value": {
            "Fn::GetAtt": [
              "ElasticIp",
              "AllocationId"
            ]
          }
        },
        "EipAddress": {
          "Description": "IP address of created EIP.",
          "Value": {
            "Fn::GetAtt": [
              "ElasticIp",
              "EipAddress"
            ]
          }
        },
        "OrderId": {
          "Description": "Order ID of prepaid EIP instance.",
          "Value": {
            "Fn::GetAtt": [
              "ElasticIp",
              "OrderId"
            ]
          }
        }
      }
    }

For more examples, visit Eip.json and Eip.yml.