ALIYUN::VPC::DhcpOptionsSet

更新时间:
复制为 MD 格式

ALIYUN::VPC::DhcpOptionsSet类型用于创建动态主机配置协议DHCP(Dynamic Host Configuration Protocol)选项集。

语法

{
  "Type": "ALIYUN::VPC::DhcpOptionsSet",
  "Properties": {
    "DomainName": String,
    "DhcpOptionsSetName": String,
    "DhcpOptionsSetDescription": String,
    "DomainNameServers": List,
    "ResourceGroupId": String,
    "LeaseTime": String,
    "Ipv6LeaseTime": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

DomainName

String

主机名后缀

取值示例:example.com。

DHCP选项集关联VPC后,会自动将主机名后缀同步给VPC中的ECS实例。

DhcpOptionsSetName

String

DHCP选项集的名称

长度为2~128个字符,以英文字母或汉字开头,可包含数字、下划线(_)和短划线(-)。

DhcpOptionsSetDescription

String

DHCP选项集的描述

长度为2~256个字符,不能以http://https://开头。

DomainNameServers

List

DNS服务器IP地址

最多指定4DNS服务器IP地址。

说明

未指定任何DNS服务器IP地址时,ECS实例默认使用阿里云提供的DNS服务器IP地址(100.100.2.136100.100.2.138)。

ResourceGroupId

String

DHCP 选项集所属的资源组 ID。

LeaseTime

String

IPv4 DHCP 选项集的租赁时间。

  • 租赁时间设置为小时时:单位:h。取值范围:24h~1176h87600h~175200h。 默认值:87600h

  • 租赁时间设置为天时:单位:d。取值范围: 1d~49d3650d~7300d。 默认值:3650d 。

说明

输入参数取值时,必须输入参数的单位。

Ipv6LeaseTime

String

IPv6 DHCP 选项集的租赁时间。

  • 租赁时间设置为小时时:单位:h。取值范围:24h~1176h87600h~175200h。 默认值:24h

  • 租赁时间设置为天时:单位:d。取值范围: 1d~49d3650d~7300d。 默认值:1d 。

说明

输入参数取值时,必须输入参数的单位。

返回值

Fn::GetAtt

DhcpOptionsSetId:创建成功的DHCP选项集的ID。

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  DomainName:
    Type: String
    Description: |-
      The root domain, for example, example.com.
      After a DHCP options set is associated with a Virtual Private Cloud (VPC) network, the root domain in the DHCP options set is automatically synchronized to the ECS instances in the VPC network.
    Default: example.com
  DhcpOptionsSetName:
    Type: String
    Description: |-
      The name of the DHCP options set.
      The name must be 2 to 128 characters in length and can contain letters, Chinese characters, digits, underscores (_), and hyphens (-). It must start with a letter or a Chinese character.
    Default: test
  DhcpOptionsSetDescription:
    Type: String
    Description: |-
      The description of the DHCP options set.
      The description must be 2 to 256 characters in length and cannot start with http:// or https://.
    Default: test
  DomainNameServers:
    Type: Json
    Description: The DNS server IP addresses. Note Before you specify any DNS server
      IP address, all ECS instances in the associated VPC network use the IP addresses
      of the Alibaba Cloud DNS servers, which are 100.100.2.136 and 100.100.2.138.
    Default:
    - 100.100.2.136
    - 100.100.2.138
Resources:
  DhcpOptionsSet:
    Type: ALIYUN::VPC::DhcpOptionsSet
    Properties:
      DomainName:
        Ref: DomainName
      DhcpOptionsSetName:
        Ref: DhcpOptionsSetName
      DhcpOptionsSetDescription:
        Ref: DhcpOptionsSetDescription
      DomainNameServers:
        Ref: DomainNameServers
Outputs:
  DhcpOptionsSetId:
    Description: The ID of the DHCP options set that is created.
    Value:
      Fn::GetAtt:
      - DhcpOptionsSet
      - DhcpOptionsSetId
            
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "DomainName": {
      "Type": "String",
      "Description": "The root domain, for example, example.com.\nAfter a DHCP options set is associated with a Virtual Private Cloud (VPC) network, the root domain in the DHCP options set is automatically synchronized to the ECS instances in the VPC network.",
      "Default": "example.com"
    },
    "DhcpOptionsSetName": {
      "Type": "String",
      "Description": "The name of the DHCP options set.\nThe name must be 2 to 128 characters in length and can contain letters, Chinese characters, digits, underscores (_), and hyphens (-). It must start with a letter or a Chinese character.",
      "Default": "test"
    },
    "DhcpOptionsSetDescription": {
      "Type": "String",
      "Description": "The description of the DHCP options set.\nThe description must be 2 to 256 characters in length and cannot start with http:// or https://.",
      "Default": "test"
    },
    "DomainNameServers": {
      "Type": "Json",
      "Description": "The DNS server IP addresses. Note Before you specify any DNS server IP address, all ECS instances in the associated VPC network use the IP addresses of the Alibaba Cloud DNS servers, which are 100.100.2.136 and 100.100.2.138.",
      "Default": [
        "100.100.2.136",
        "100.100.2.138"
      ]
    }
  },
  "Resources": {
    "DhcpOptionsSet": {
      "Type": "ALIYUN::VPC::DhcpOptionsSet",
      "Properties": {
        "DomainName": {
          "Ref": "DomainName"
        },
        "DhcpOptionsSetName": {
          "Ref": "DhcpOptionsSetName"
        },
        "DhcpOptionsSetDescription": {
          "Ref": "DhcpOptionsSetDescription"
        },
        "DomainNameServers": {
          "Ref": "DomainNameServers"
        }
      }
    }
  },
  "Outputs": {
    "DhcpOptionsSetId": {
      "Description": "The ID of the DHCP options set that is created.",
      "Value": {
        "Fn::GetAtt": [
          "DhcpOptionsSet",
          "DhcpOptionsSetId"
        ]
      }
    }
  }
}