文档

ALIYUN::VPC::HaVip

更新时间:

ALIYUN::VPC::HaVip类型用于申请高可用虚拟IP。

重要

每个VPC下最多同时可以拥有5个HaVip实例。

语法

{
  "Type": "ALIYUN::VPC::HaVip",
  "Properties": {
    "VSwitchId":  String,
    "IpAddress":  String,
    "Description": String,
    "Tags": List,
    "Name": String,
    "ResourceGroupId": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

VSwitchId

String

交换机ID。

无。

IpAddress

String

HaVip的IP地址。

不填写该地址,则随机指定当前交换机下的一个地址。

无。

Description

String

自定义描述信息。

0~256个英文或中文字符,不能以http://https://开头。

Name

String

HaVip 实例的名称。

名称长度为 1~128 个字符,不能以http://https://开头。

ResourceGroupId

String

高可用虚拟 IP 所属的资源组 ID。

Tags

List

自定义标签。

更多信息,请参见Tags属性。

Tags语法

"Tags": [
  {
    "Key": String,
    "Value": String
  }
]

Tags属性

属性名称

类型

必须

允许更新

描述

约束

Key

String

标签键。

长度为1~128个字符,不能以aliyunacs:开头,不能包含http://https://

Value

String

标签值。

长度为0~128个字符,不能以aliyunacs:开头,不能包含http://https://

返回值

Fn::GetAtt

HaVipId:高可用虚拟IP ID。

示例

YAML格式

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  ZoneId:
    Type: String
    Description: Create an Availability Zone for an instance to ensure that the Availability Zone supports the creation of Memcache resource specifications.
    AssociationProperty: ALIYUN::ECS::Instance::ZoneId
    Label: Zone ID
  VSwitch:
    AssociationProperty: ALIYUN::ECS::VSwitch::VSwitchId
    Type: String
    Description: Please search the business VSwitch ID starts with(vsw-xxx)from console-Virtual Private Cloud-VSwitches
    Label: Existing VSwitch ID
    AssociationPropertyMetadata:
      ZoneId: ZoneId
Resources:
  HaVip:
    Type: ALIYUN::VPC::HaVip
    Properties:
      VSwitchId:
        Ref: VSwitch
Outputs:
  HaVipId:
    Value:
      Fn::GetAtt:
        - HaVip
        - HaVipId

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "ZoneId": {
      "Type": "String",
      "Description": "Create an Availability Zone for an instance to ensure that the Availability Zone supports the creation of Memcache resource specifications.",
      "AssociationProperty": "ALIYUN::ECS::Instance::ZoneId",
      "Label": "Zone ID"
    },
    "VSwitch": {
      "AssociationProperty": "ALIYUN::ECS::VSwitch::VSwitchId",
      "Type": "String",
      "Description": "Please search the business VSwitch ID starts with(vsw-xxx)from console-Virtual Private Cloud-VSwitches",
      "Label": "Existing VSwitch ID",
      "AssociationPropertyMetadata": {
        "ZoneId": "ZoneId"
      }
    }
  },
  "Resources": {
    "HaVip": {
      "Type": "ALIYUN::VPC::HaVip",
      "Properties": {
        "VSwitchId": {
          "Ref": "VSwitch"
        }
      }
    }
  },
  "Outputs": {
    "HaVipId": {
      "Value": {
        "Fn::GetAtt": [
          "HaVip",
          "HaVipId"
        ]
      }
    }
  }
}