ALIYUN::ECS::NetworkInterfaceAttachment類型用於綁定彈性網卡(ENI)到Virtual Private Cloud類型執行個體上。
文法
{
"Type": "ALIYUN::ECS::NetworkInterfaceAttachment",
"Properties": {
"InstanceId": String,
"NetworkInterfaceId": String,
"TrunkNetworkInstanceId": String,
"EcsRestartOption": String
}
}
屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
InstanceId | String | 是 | 否 | 執行個體ID。 | 無 |
NetworkInterfaceId | String | 是 | 否 | 彈性網卡ID。 | 無 |
TrunkNetworkInstanceId | String | 否 | 否 | Trunk網卡ID。 | 無 |
EcsRestartOption | String | 否 | 否 | 控制綁定彈性網卡時是否重啟ECS執行個體。 | 取值: |
樣本
YAML
格式
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
InstanceId:
Type: String
AssociationProperty: ALIYUN::ECS::Instance::InstanceId
NetworkInterfaceId:
Type: String
Description: Network interface id
Resources:
EniAttachment:
Type: ALIYUN::ECS::NetworkInterfaceAttachment
Properties:
InstanceId:
Ref: InstanceId
NetworkInterfaceId:
Ref: NetworkInterfaceId
Outputs:
TrunkNetworkInstanceId:
Description: ID of Trunk Network Interface.
Value:
Fn::GetAtt:
- EniAttachment
- TrunkNetworkInstanceId
NetworkInterfaceId:
Description: ID of your Network Interface.
Value:
Fn::GetAtt:
- EniAttachment
- NetworkInterfaceId
InstanceId:
Description: ID of instance.
Value:
Fn::GetAtt:
- EniAttachment
- InstanceId
JSON
格式
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"InstanceId": {
"Type": "String",
"AssociationProperty": "ALIYUN::ECS::Instance::InstanceId",
},
"NetworkInterfaceId": {
"Type": "String",
"Description": "Network interface id"
}
},
"Resources": {
"EniAttachment": {
"Type": "ALIYUN::ECS::NetworkInterfaceAttachment",
"Properties": {
"InstanceId": {
"Ref": "InstanceId"
},
"NetworkInterfaceId": {
"Ref": "NetworkInterfaceId"
}
}
}
},
"Outputs": {
"TrunkNetworkInstanceId": {
"Description": "ID of Trunk Network Interface.",
"Value": {
"Fn::GetAtt": [
"EniAttachment",
"TrunkNetworkInstanceId"
]
}
},
"NetworkInterfaceId": {
"Description": "ID of your Network Interface.",
"Value": {
"Fn::GetAtt": [
"EniAttachment",
"NetworkInterfaceId"
]
}
},
"InstanceId": {
"Description": "ID of instance.",
"Value": {
"Fn::GetAtt": [
"EniAttachment",
"InstanceId"
]
}
}
}
}
更多樣本,請參見建立一個彈性網卡、綁定彈性網卡到專用網路類型執行個體和授權彈性網卡的組合樣本:JSON樣本和YAML樣本。