Todos os produtos
Search
Central de documentação

Resource Orchestration Service:ALIYUN::VPC::DhcpOptionsSet

Última atualização: Jun 27, 2026

Cria um conjunto de opções do Dynamic Host Configuration Protocol (DHCP).

Sintaxe

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

Propriedades

Parâmetro

Tipo

Obrigatório

Atualização permitida

Descrição

Restrições

DomainName

String

Não

Sim

Nome de domínio.

Exemplo: example.com.

Após a associação de um conjunto de opções DHCP a uma Virtual Private Cloud (VPC), o domínio raiz é sincronizado automaticamente com as instâncias do Elastic Compute Service (ECS) na VPC.

DhcpOptionsSetName

String

Não

Sim

Nome do conjunto de opções DHCP.

O nome deve ter de 2 a 128 caracteres. Deve começar com uma letra ou caractere chinês e pode conter letras, caracteres chineses, dígitos, sublinhados (_) e hifens (-).

DhcpOptionsSetDescription

String

Não

Sim

Descrição do conjunto de opções DHCP.

A descrição deve ter de 2 a 256 caracteres e não pode começar com http:// ou https://.

DomainNameServers

List

Não

Sim

Endereços IP dos servidores DNS.

Especifique até quatro endereços IP de servidores DNS.

Nota

Se você não especificar este parâmetro, as instâncias ECS usarão os servidores DNS padrão da Alibaba Cloud: 100.100.2.136 e 100.100.2.138.

ResourceGroupId

String

Não

Não

ID do grupo de recursos do conjunto de opções DHCP.

Nenhuma

LeaseTime

String

Não

Não

Tempo de concessão IPv4 do conjunto de opções DHCP.

  • Valores válidos em horas: 24h a 1176h e 87600h a 175200h. Padrão: 87600h.

  • Valores válidos em dias: 1d a 49d e 3650d a 7300d. Padrão: 3650d.

Nota

Inclua a unidade no valor.

Ipv6LeaseTime

String

Não

Não

Tempo de concessão IPv6 do conjunto de opções DHCP.

  • Valores válidos em horas: 24h a 1176h e 87600h a 175200h. Padrão: 24h.

  • Valores válidos em dias: 1d a 49d e 3650d a 7300d. Padrão: 1d.

Nota

Inclua a unidade no valor.

Parâmetros de resposta

Fn::GetAtt

DhcpOptionsSetId: ID do conjunto de opções DHCP.

Exemplos

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