全部產品
Search
文件中心

Resource Orchestration Service:ALIYUN::VPC::CustomerGateway

更新時間:Feb 05, 2024

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