全部产品
Search
文档中心

资源编排:ALIYUN::VPC::CustomerGateway

更新时间:Nov 02, 2023

ALIYUN::VPC::CustomerGateway类型用于创建用户网关。

语法

{
  "Type": "ALIYUN::VPC::CustomerGateway",
  "Properties": {
    "IpAddress": String,
    "Description": String,
    "Name": String,
    "Asn": Integer
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

IpAddress

String

用户网关的IP地址。

无。

Description

String

用户网关的描述信息。

长度为2~256个字符。必须以字母或中文开头,不能以http://或https://开头。

Name

String

用户网关的名称。

长度为2~128个字符。必须以字母或中文开头,可包含数字、点号(.)、下划线(_)和短横线(-),不能以http://或https://开头。

Asn

Integer

本地数据中心网关设备的自治系统号。

Asn是一个4字节的号码,支持按照两段位的格式进行输入,即:前16位比特.后16位比特。每个段位使用十进制输入。

例如输入123.456,则表示自治系统号:123*65536+456=8061384。

返回值

Fn::GetAtt

CustomerGatewayId:用户网关的ID。

示例

YAML格式

ROSTemplateFormatVersion: '2015-09-01'
Resources:
  CustomerGateway:
    Type: ALIYUN::VPC::CustomerGateway
    Properties:
      IpAddress:
        Ref: IpAddress
      Description:
        Ref: Description
      Name:
        Ref: Name
Parameters:
  IpAddress:
    Type: String
    Description: The IP address of the user gateway.
  Description:
    MinLength: 2
    Type: String
    Description: Description of the user gateway. The length is 2-256 characters and must start with a letter or Chinese, but cannot start with http:// or https://.
    MaxLength: 256
  Name:
    MinLength: 2
    Type: String
    Description: The name of the user gateway. The length is 2-128 characters and must start with a letter or Chinese. It can contain numbers, periods (.), underscores (_), and dashes (-). But it can't start with http:// or https://.
    MaxLength: 128
Outputs:
  CustomerGatewayId:
    Description: The ID of the user gateway.
    Value:
      Fn::GetAtt:
        - CustomerGateway
        - CustomerGatewayId

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Resources": {
    "CustomerGateway": {
      "Type": "ALIYUN::VPC::CustomerGateway",
      "Properties": {
        "IpAddress": {
          "Ref": "IpAddress"
        },
        "Description": {
          "Ref": "Description"
        },
        "Name": {
          "Ref": "Name"
        }
      }
    }
  },
  "Parameters": {
    "IpAddress": {
      "Type": "String",
      "Description": "The IP address of the user gateway."
    },
    "Description": {
      "MinLength": 2,
      "Type": "String",
      "Description": "Description of the user gateway. The length is 2-256 characters and must start with a letter or Chinese, but cannot start with http:// or https://.",
      "MaxLength": 256
    },
    "Name": {
      "MinLength": 2,
      "Type": "String",
      "Description": "The name of the user gateway. The length is 2-128 characters and must start with a letter or Chinese. It can contain numbers, periods (.), underscores (_), and dashes (-). But it can't start with http:// or https://.",
      "MaxLength": 128
    }
  },
  "Outputs": {
    "CustomerGatewayId": {
      "Description": "The ID of the user gateway.",
      "Value": {
        "Fn::GetAtt": [
          "CustomerGateway",
          "CustomerGatewayId"
        ]
      }
    }
  }
}