语法
{
"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示例。