ALIYUN::ECS::NetworkInterfaceAttachment類型用于綁定彈性網卡(ENI)到專有網絡(VPC)類型實例上。
語法
{
"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實例。 | 取值:
|
返回值
Fn::GetAtt
NetworkInterfaceId:彈性網卡ID。
TrunkNetworkInstanceId:Trunk網卡ID。
InstanceId:實例ID。
示例
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
{ "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" ] } } } }
文檔內容是否對您有幫助?