Tous les produits
Search
Centre de documentation

Resource Orchestration Service:ALIYUN::ECS::NetworkInterfaceAttachment

Dernière mise à jour :Aug 20, 2026

La ressource ALIYUN::ECS::NetworkInterfaceAttachment associe une interface réseau élastique (ENI) à une instance Elastic Compute Service (ECS) dans un VPC.

Syntaxe

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

Propriétés

Propriété

Type

Obligatoire

Modifiable

Description

Contrainte

InstanceId

String

Oui

Non

ID de l'instance.

Aucune.

NetworkInterfaceId

String

Oui

Non

ID de l'ENI.

Aucune.

TrunkNetworkInstanceId

String

Non

Non

ID de l'interface réseau trunk.

Aucune.

EcsRestartOption

String

Non

Non

Indique si l'instance ECS doit redémarrer lors de l'association d'une ENI.

Valeurs valides :

  • Auto

  • NotRestart

  • Restart

Valeurs de retour

Fn::GetAtt

  • NetworkInterfaceId : ID de l'ENI.

  • TrunkNetworkInstanceId : ID de l'interface réseau trunk.

  • InstanceId : ID de l'instance.

Exemples

  • YAML format

    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 format

    {
      "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"
            ]
          }
        }
      }
    }