All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::VPC::DhcpOptionsSet

Last Updated:Mar 28, 2026

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,
    "ResourceGroupId": String,
    "LeaseTime": String,
    "Ipv6LeaseTime": String
  }
}

Properties

Parameter

Type

Required

Update Allowed

Description

Constraints

DomainName

String

No

Yes

The domain name.

For 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 long. It must start with a letter or a Chinese character and can contain letters, Chinese characters, digits, underscores (_), and hyphens (-).

DhcpOptionsSetDescription

String

No

Yes

The description of the DHCP options set.

The description must be 2 to 256 characters long and cannot start with http:// or https://.

DomainNameServers

List

No

Yes

The IP addresses of the DNS servers.

You can specify up to four IP addresses for the DNS servers.

Note

If you do not specify this parameter, ECS instances use the default Alibaba Cloud DNS servers: 100.100.2.136 and 100.100.2.138.

ResourceGroupId

String

No

No

The ID of the resource group for the DHCP options set.

None

LeaseTime

String

No

No

The IPv4 lease time of the DHCP options set.

  • Valid values in hours: 24h to 1176h and 87600h to 175200h. Default: 87600h.

  • Valid values in days: 1d to 49d and 3650d to 7300d. Default: 3650d.

Note

You must include the unit in the value.

Ipv6LeaseTime

String

No

No

The IPv6 lease time of the DHCP options set.

  • Valid values in hours: 24h to 1176h and 87600h to 175200h. Default: 24h.

  • Valid values in days: 1d to 49d and 3650d to 7300d. Default: 1d.

Note

You must include the unit in the value.

Response parameters

Fn::GetAtt

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

Examples

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), the VPC automatically synchronizes the root domain to the ECS instances in the VPC.
    Default: example.com
  DhcpOptionsSetName:
    Type: String
    Description: |-
      The name of the DHCP options set.
      The name must be 2 to 128 characters long. It must start with a letter or a Chinese character and can contain letters, Chinese characters, digits, underscores (_), and hyphens (-).
    Default: test
  DhcpOptionsSetDescription:
    Type: String
    Description: |-
      The description of the DHCP options set.
      The description must be 2 to 256 characters long and cannot start with http:// or https://.
    Default: test
  DomainNameServers:
    Type: Json
    Description: The IP addresses of the DNS servers. If you do not specify this parameter, ECS instances in the associated VPC use the Alibaba Cloud DNS server IP addresses: 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), the VPC automatically synchronizes the root domain to the ECS instances in the VPC.",
      "Default": "example.com"
    },
    "DhcpOptionsSetName": {
      "Type": "String",
      "Description": "The name of the DHCP options set.\nThe name must be 2 to 128 characters long. It must start with a letter or a Chinese character and can contain letters, Chinese characters, digits, underscores (_), and hyphens (-).",
      "Default": "test"
    },
    "DhcpOptionsSetDescription": {
      "Type": "String",
      "Description": "The description of the DHCP options set.\nThe description must be 2 to 256 characters long and cannot start with http:// or https://.",
      "Default": "test"
    },
    "DomainNameServers": {
      "Type": "Json",
      "Description": "The IP addresses of the DNS servers. If you do not specify this parameter, ECS instances in the associated VPC use the Alibaba Cloud DNS server IP addresses: 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"
        ]
      }
    }
  }
}