ALIYUN::VPC::EIP類型用于申請彈性公網IP(Elastic IP Address,簡稱EIP)。
語法
{
"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,
"Zone": String
}
}
屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
DeletionProtection | Boolean | 否 | 是 | 是否開啟刪除保護功能。 | 取值:
|
Name | String | 否 | 是 | EIP的名稱。 | 長度為2~128個字符。以英文字母開頭,不能以 |
ResourceGroupId | String | 否 | 是 | 資源組ID。 | 無 |
Netmode | String | 否 | 否 | 網絡類型。 | 取值:public,表示公網。 |
Bandwidth | Number | 否 | 是 | EIP的帶寬值。 | 如果不指定,則取默認值5 Mbps。 |
InternetChargeType | String | 否 | 否 | EIP的計費方式。 | 取值:
|
InstanceChargeType | String | 否 | 否 | EIP的付費方式。 | 取值:
|
PricingCycle | String | 否 | 否 | 預付費的計費周期。 | 取值:
說明 InstanceChargeType取值為Prepaid時,PricingCycle必選。 |
Period | Number | 否 | 否 | 購買時長。 | 取值:
默認值:1。 說明 InstanceChargeType取值為Prepaid時,Period必選。 |
AutoPay | Boolean | 否 | 否 | 是否開啟自動付費。 | 取值:
說明 InstanceChargeType取值為Prepaid時,AutoPay必選。 |
Isp | String | 否 | 否 | 線路類型。 | 取值:
目前,全部地域都支持BGP(多線)線路EIP,僅中國香港地域支持BGP(多線)精品線路EIP。 說明 如果是開通了單線帶寬白名單的用戶,Isp可以設置為ChinaTelecom(中國電信)、ChinaUnicom(中國聯通)和ChinaMobile(中國移動);如果是杭州金融云用戶,Isp必填,取值:BGP_FinanceCloud。 |
Description | String | 否 | 是 | EIP的描述信息。 | 長度為2~256個字符。以英文字母開頭,不能以 |
Tags | List | 否 | 是 | 標簽。 | 最多設置20個標簽,每個標簽由鍵值對組成。標簽值可以為空。 |
SecurityProtectionTypes | List | 否 | 否 | 安全防護級別。 | 取值:
說明 您最多可以設置10個安全防護級別。 |
PublicIpAddressPoolId | String | 否 | 否 | IP地址池ID。 | EIP將從該IP地址池中分配,IP地址池僅對通過試用申請的用戶可見。如需使用,請提交工單。 |
Zone | String | 否 | 否 | 彈性公網IP可用分區。 | 無 |
Tags語法
"Tags": [
{
"Key": String,
"Value": String
}
]
Tags屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
Key | String | 是 | 否 | 標簽鍵。 | 長度為1~128個字符,不能以 |
Value | String | 否 | 否 | 標簽值。 | 長度為0~128個字符,不能以 |
返回值
Fn::GetAtt
EipAddress:分配的EIP。
AllocationId:EIP的實例ID。
OrderId:訂單號,僅InstanceChargeType取值為Prepaid時返回。
Isp:線路類型。
示例
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
{
"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"
]
}
}
}
}