Creates a Dynamic Host Configuration Protocol (DHCP) options set.
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, After a DHCP options set is associated with a virtual private cloud (VPC), the root domain is automatically synchronized to 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 |
|
DomainNameServers |
List |
No |
Yes |
The IP addresses of the DNS servers. |
You can specify up to four DNS server IP addresses. 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 resource group ID of the DHCP options set. |
None |
|
LeaseTime |
String |
No |
No |
The IPv4 lease time of the DHCP options set. |
Note
You must include the unit in the value. |
|
Ipv6LeaseTime |
String |
No |
No |
The IPv6 lease time of the DHCP options set. |
Note
You must include the unit in the value. |
Response parameters
Fn::GetAtt
DhcpOptionsSetId: the ID of the DHCP options set.
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"
]
}
}
}
}