文档

ALIYUN::ENS::Network

更新时间:

ALIYUN::ENS::Network类型用于创建一个专有网络。

语法

{
  "Type": "ALIYUN::ENS::Network",
  "Properties": {
    "NetworkName": String,
    "Description": String,
    "CidrBlock": String,
    "EnsRegionId": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

NetworkName

String

网络名称。

命名规则如下:

  • 长度为2~128个英文或中文字符。

  • 必须以大小字母或中文开头,不能以http://https://开头。

  • 可以包含数字、英文冒号(:)、下划线(_)或者短划线(-)。

Description

String

描述信息。

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

CidrBlock

String

网络的网段。

您可以使用以下网段或其子集作为Network 的网段:

  • 10.0.0.0/8(默认值)

  • 172.16.0.0/12

  • 192.168.0.0/16

EnsRegionId

String

ENS的节点ID。

返回值

Fn::GetAtt

NetworkId:网络ID。

示例

  • YAML格式

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      CidrBlock:
        Description:
          en: 'The CIDR block of the network. You can use one of the following CIDR blocks
            or their subnets as the CIDR block of the network:
    
            10.0.0.0/8 (default)
    
            172.16.0.0/12
    
            192.168.0.0/16'
        Required: true
        Type: String
      Description:
        AssociationProperty: TextArea
        Description:
          en: 'The description of the network.
    
            The description must be 2 to 256 characters in length. It must start with
            a letter but cannot start with http:// or https://.'
        Required: false
        Type: String
      EnsRegionId:
        Description:
          en: The ID of the edge node.
        Required: true
        Type: String
      NetworkName:
        Description:
          en: 'The name of the network. The name must meet the following requirements:
    
            The name must be 2 to 128 characters in length.
    
            The name must start with a letter but cannot start with http:// or https://.
    
            The name can contain letters, digits, colons (:), underscores (_), and hyphens
            (-).'
        Required: false
        Type: String
    Resources:
      Network:
        Properties:
          CidrBlock:
            Ref: CidrBlock
          Description:
            Ref: Description
          EnsRegionId:
            Ref: EnsRegionId
          NetworkName:
            Ref: NetworkName
        Type: ALIYUN::ENS::Network
    Outputs:
      NetworkId:
        Description: The ID of the network.
        Value:
          Fn::GetAtt:
          - Network
          - NetworkId
                            
  • JSON格式

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "NetworkName": {
          "Type": "String",
          "Description": {
            "en": "The name of the network. The name must meet the following requirements:\nThe name must be 2 to 128 characters in length.\nThe name must start with a letter but cannot start with http:// or https://.\nThe name can contain letters, digits, colons (:), underscores (_), and hyphens (-)."
          },
          "Required": false
        },
        "Description": {
          "AssociationProperty": "TextArea",
          "Type": "String",
          "Description": {
            "en": "The description of the network.\nThe description must be 2 to 256 characters in length. It must start with a letter but cannot start with http:// or https://."
          },
          "Required": false
        },
        "CidrBlock": {
          "Type": "String",
          "Description": {
            "en": "The CIDR block of the network. You can use one of the following CIDR blocks or their subnets as the CIDR block of the network:\n10.0.0.0/8 (default)\n172.16.0.0/12\n192.168.0.0/16"
          },
          "Required": true
        },
        "EnsRegionId": {
          "Type": "String",
          "Description": {
            "en": "The ID of the edge node."
          },
          "Required": true
        }
      },
      "Resources": {
        "Network": {
          "Type": "ALIYUN::ENS::Network",
          "Properties": {
            "NetworkName": {
              "Ref": "NetworkName"
            },
            "Description": {
              "Ref": "Description"
            },
            "CidrBlock": {
              "Ref": "CidrBlock"
            },
            "EnsRegionId": {
              "Ref": "EnsRegionId"
            }
          }
        }
      },
      "Outputs": {
        "NetworkId": {
          "Description": "The ID of the network.",
          "Value": {
            "Fn::GetAtt": [
              "Network",
              "NetworkId"
            ]
          }
        }
      }
    }
                            
  • 本页导读 (1)
文档反馈