ALIYUN::ECS::NetworkInterfaceAttachment is used to attach an elastic network interface (ENI) to an ECS instance in a VPC.

Syntax

{
  "Type": "ALIYUN::ECS::NetworkInterfaceAttachment",
  "Properties": {
    "InstanceId": String,
    "NetworkInterfaceId": String,
    "TrunkNetworkInstanceId": String
  }
}

Properties

Property Type Required Editable Description Constraint
InstanceId String Yes No The ID of the ECS instance. None
NetworkInterfaceId String Yes No The ID of the ENI. None
TrunkNetworkInstanceId String No No The ID of the trunk network interface. None

Response parameters

Fn::GetAtt

  • NetworkInterfaceId: the ID of the ENI.
  • TrunkNetworkInstanceId: the ID of the trunk network interface.

Examples

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "InstanceId": {
      "Type": "String",
      "Description": "ECS instance id"
    },
    "TrunkNetworkInstanceId": {
      "Type": "String"
    },
    "NetworkInterfaceId": {
      "Type": "String",
      "Description": "Network interface id"
    }
  },
  "Resources": {
    "EniAttachment": {
      "Type": "ALIYUN::ECS::NetworkInterfaceAttachment",
      "Properties": {
        "InstanceId": {
          "Ref": "InstanceId"
        },
        "TrunkNetworkInstanceId": {
          "Ref": "TrunkNetworkInstanceId"
        },
        "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"
        ]
      }
    }
  }
}

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  InstanceId:
    Type: String
    Description: ECS instance id
  TrunkNetworkInstanceId:
    Type: String
  NetworkInterfaceId:
    Type: String
    Description: Network interface id
Resources:
  EniAttachment:
    Type: 'ALIYUN::ECS::NetworkInterfaceAttachment'
    Properties:
      InstanceId:
        Ref: InstanceId
      TrunkNetworkInstanceId:
        Ref: TrunkNetworkInstanceId
      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