全部产品
Search
文档中心

资源编排:ALIYUN::OTS::VpcBinder

更新时间:Apr 18, 2023

ALIYUN::OTS::VpcBinder类型用于将实例绑定到专有网络。

语法

{
  "Type": "ALIYUN::OTS::VpcBinder",
  "Properties": {
    "Vpcs": List,
    "InstanceName": String
  }
}            

属性

属性名称

类型

必须

允许更新

描述

约束

Vpcs

List

绑定关系列表。

元素类型为:VpcInfo。

InstanceName

String

实例名称。

Vpcs语法

"Vpcs":[
  {
    "VpcId":String,
    "InstanceVpcName":String,
    "VirtualSwitchId": String,
    "Network": String
  }
]           

Vpcs属性

属性名称

类型

必须

允许更新

描述

约束

VpcId

String

专有网络实例ID。

专有网络实例需要与表格存储实例属于同一用户、同一个地域。

InstanceVpcName

String

自定义名称。

需要在表格存储实例下唯一。

VirtualSwitchId

String

虚拟交换机ID。

需要属于上述专有网络实例。

Network

String

实例网络类型。

取值:

  • NORMAL(默认值):实例对请求来源不做限制。

  • VPC:实例只允许来自于其绑定的专有网络的请求。

  • VPC_CONSOLE:实例只允许来自于控制台和其绑定的专有网络的请求。

返回值

Fn::GetAtt

  • Domains: 专有网络内用于访问表格存储实例的域名。

  • Endpoints: 专有网络内用于访问表格存储实例的私网地址。

示例

YAML格式

ROSTemplateFormatVersion: '2015-09-01'
Description: Test OTS Table、Instance、VpcBinder
Parameters:
  InstanceName:
    Type: String
    Description: OTS Instance name
    Default: mytest
  InstanceVpcName:
    Type: String
    Description: Instance name
    Default: mytest
  VSwitchZoneId:
    Type: String
    AssociationProperty: ALIYUN::ECS::Instance::ZoneId
    Description: Availability ID for existing switches
    Label: VSwitch Zone ID
  VpcId:
    Type: String
    Default: Null
    AssociationProperty: ALIYUN::ECS::VPC::VPCId
    Description: Please search the ID starts with (vpc-xxx)from console-Virtual Private Cloud
    Label: Existing VPC ID
  VSwitchId:
    Type: String
    Default: Null
    AssociationProperty: ALIYUN::ECS::VSwitch::VSwitchId
    Description: Please search the business VSwitch ID starts with(vsw-xxx)from console-Virtual Private Cloud-VSwitches
    Label: VSwitch ID
    AssociationPropertyMetadata:
      ZoneId: ${VSwitchZoneId}
      VpcId: ${VpcId}
Resources:
  VpcBinder:
    Type: ALIYUN::OTS::VpcBinder
    Properties:
      InstanceName:
        Ref: InstanceName
      Vpcs:
        - VpcId:
            Ref: VpcId
          InstanceVpcName:
            Ref: InstanceVpcName
          VirtualSwitchId:
            Ref: VSwitchZoneId
          Network: NORMAL
Outputs:
  Domains:
    Value:
      Fn::GetAtt:
        - VpcBinder
        - Domains
  Endpoints:
    Value:
      Fn::GetAtt:
        - VpcBinder
        - Endpoints

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Description": "Test OTS Table、Instance、VpcBinder",
  "Parameters": {
    "InstanceName": {
      "Type": "String",
      "Description": "OTS Instance name",
      "Default": "mytest"
    },
    "InstanceVpcName": {
      "Type": "String",
      "Description": "Instance name",
      "Default": "mytest"
    },
    "VSwitchZoneId": {
      "Type": "String",
      "AssociationProperty": "ALIYUN::ECS::Instance::ZoneId",
      "Description": "Availability ID for existing switches",
      "Label": "VSwitch Zone ID"
    },
    "VpcId": {
      "Type": "String",
      "Default": null,
      "AssociationProperty": "ALIYUN::ECS::VPC::VPCId",
      "Description": "Please search the ID starts with (vpc-xxx)from console-Virtual Private Cloud",
      "Label": "Existing VPC ID"
    },
    "VSwitchId": {
      "Type": "String",
      "Default": null,
      "AssociationProperty": "ALIYUN::ECS::VSwitch::VSwitchId",
      "Description": "Please search the business VSwitch ID starts with(vsw-xxx)from console-Virtual Private Cloud-VSwitches",
      "Label": "VSwitch ID",
      "AssociationPropertyMetadata": {
        "ZoneId": "${VSwitchZoneId}",
        "VpcId": "${VpcId}"
      }
    }
  },
  "Resources": {
    "VpcBinder": {
      "Type": "ALIYUN::OTS::VpcBinder",
      "Properties": {
        "InstanceName": {
          "Ref": "InstanceName"
        },
        "Vpcs": [
          {
            "VpcId": {
              "Ref": "VpcId"
            },
            "InstanceVpcName": {
              "Ref": "InstanceVpcName"
            },
            "VirtualSwitchId": {
              "Ref": "VSwitchZoneId"
            },
            "Network": "NORMAL"
          }
        ]
      }
    }
  },
  "Outputs": {
    "Domains": {
      "Value": {
        "Fn::GetAtt": [
          "VpcBinder",
          "Domains"
        ]
      }
    },
    "Endpoints": {
      "Value": {
        "Fn::GetAtt": [
          "VpcBinder",
          "Endpoints"
        ]
      }
    }
  }
}