ALIYUN::VPC::DhcpOptionsSet is used to create Dynamic Host Configuration Protocol (DHCP) options sets.

Syntax

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

Properties

Property Type Required Editable Description Constraint
DomainName String No No The suffix of the hostname. Example: example.com.

After a DHCP options set is associated with a virtual private cloud (VPC), the root domain in the DHCP options set is automatically synchronized with the Elastic Compute Service (ECS) instances in the VPC.

DhcpOptionsSetName String No Yes The name of the DHCP options set. The name must be 2 to 128 characters in length and can contain letters, digits, underscores (_), and hyphens (-). It must start with a letter.
DhcpOptionsSetDescription String No Yes The description of the DHCP options set. The description must be 2 to 256 characters in length and cannot start with http:// or https://.
DomainNameServers List No Yes The DNS server IP addresses. Up to four DNS server IP addresses can be specified.
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.

Response parameters

Fn::GetAtt

DhcpOptionsSetId: The ID of the DHCP options set that is created.

Examples

JSON format

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

YAML format

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