ALIYUN::ECS::AssignIpv6Addresses類型用于為彈性網卡分配IPv6地址。

語法

{
  "Type": "ALIYUN::ECS::AssignIpv6Addresses",
  "Properties": {
    "Ipv6Addresses": List,
    "Ipv6AddressCount": Integer,
    "NetworkInterfaceId": String
  }
}

屬性

屬性名稱類型必須允許更新描述約束
Ipv6AddressesList彈性網卡指定的IPv6地址。示例:["2001:db8:1234:1a00::***"]。目前僅支持指定一個IPv6地址。不能同時指定參數(shù)Ipv6Addresses和Ipv6AddressCount。
Ipv6AddressCountInteger為彈性網卡指定的隨機生成的IPv6地址數(shù)量。不能同時指定參數(shù)Ipv6Addresses和Ipv6AddressCount。
NetworkInterfaceIdString彈性網卡ID。

返回值

Fn::GetAtt

  • Ipv6Addresses:IPv6地址。
  • Ipv6AddressIds:IPv6地址ID。
  • NetworkInterfaceId:彈性網卡ID。

示例

  • YAML格式

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      NetworkInterfaceId:
        Type: String
        Description: Elastic network interface ID.
    Resources:
      AssignIpv6Addresses:
        Type: ALIYUN::ECS::AssignIpv6Addresses
        Properties:
          NetworkInterfaceId:
            Ref: NetworkInterfaceId
          Ipv6AddressCount: 1
    Outputs:
      Ipv6AddressIds:
        Description: Assigned IPv6 address IDs.
        Value:
          Fn::GetAtt:
            - AssignIpv6Addresses
            - Ipv6AddressIds
      Ipv6Addresses:
        Description: Assigned IPv6 addresses.
        Value:
          Fn::GetAtt:
            - AssignIpv6Addresses
            - Ipv6Addresses
      NetworkInterfaceId:
        Description: Elastic network interface ID.
        Value:
          Fn::GetAtt:
            - AssignIpv6Addresses
            - NetworkInterfaceId
  • JSON格式

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "NetworkInterfaceId": {
          "Type": "String",
          "Description": "Elastic network interface ID."
        }
      },
      "Resources": {
        "AssignIpv6Addresses": {
          "Type": "ALIYUN::ECS::AssignIpv6Addresses",
          "Properties": {
            "NetworkInterfaceId": {
              "Ref": "NetworkInterfaceId"
            },
            "Ipv6AddressCount": 1
          }
        }
      },
      "Outputs": {
        "Ipv6AddressIds": {
          "Description": "Assigned IPv6 address IDs.",
          "Value": {
            "Fn::GetAtt": [
              "AssignIpv6Addresses",
              "Ipv6AddressIds"
            ]
          }
        },
        "Ipv6Addresses": {
          "Description": "Assigned IPv6 addresses.",
          "Value": {
            "Fn::GetAtt": [
              "AssignIpv6Addresses",
              "Ipv6Addresses"
            ]
          }
        },
        "NetworkInterfaceId": {
          "Description": "Elastic network interface ID.",
          "Value": {
            "Fn::GetAtt": [
              "AssignIpv6Addresses",
              "NetworkInterfaceId"
            ]
          }
        }
      }
    }