Dhcp Options Set
Provides a VPC Dhcp Options Set resource. DHCP option set. For information about VPC Dhcp Options Set and how to use it, see What is Dhcp Options Set.
NOTE: Available since v1.134.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "terraform-example";
const domain = config.get("domain") || "terraform-example.com";
const example = new alicloud.vpc.DhcpOptionsSet("example", {
dhcpOptionsSetName: name,
dhcpOptionsSetDescription: name,
domainName: domain,
domainNameServers: "100.100.2.136",
});
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "terraform-example"
domain = config.get("domain")
if domain is None:
domain = "terraform-example.com"
example = alicloud.vpc.DhcpOptionsSet("example",
dhcp_options_set_name=name,
dhcp_options_set_description=name,
domain_name=domain,
domain_name_servers="100.100.2.136")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "terraform-example";
var domain = config.Get("domain") ?? "terraform-example.com";
var example = new AliCloud.Vpc.DhcpOptionsSet("example", new()
{
DhcpOptionsSetName = name,
DhcpOptionsSetDescription = name,
DomainName = domain,
DomainNameServers = "100.100.2.136",
});
});
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
name := "terraform-example"
if param := cfg.Get("name"); param != "" {
name = param
}
domain := "terraform-example.com"
if param := cfg.Get("domain"); param != "" {
domain = param
}
_, err := vpc.NewDhcpOptionsSet(ctx, "example", &vpc.DhcpOptionsSetArgs{
DhcpOptionsSetName: pulumi.String(name),
DhcpOptionsSetDescription: pulumi.String(name),
DomainName: pulumi.String(domain),
DomainNameServers: pulumi.String("100.100.2.136"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.vpc.DhcpOptionsSet;
import com.pulumi.alicloud.vpc.DhcpOptionsSetArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var config = ctx.config();
final var name = config.get("name").orElse("terraform-example");
final var domain = config.get("domain").orElse("terraform-example.com");
var example = new DhcpOptionsSet("example", DhcpOptionsSetArgs.builder()
.dhcpOptionsSetName(name)
.dhcpOptionsSetDescription(name)
.domainName(domain)
.domainNameServers("100.100.2.136")
.build());
}
}
configuration:
name:
type: string
default: terraform-example
domain:
type: string
default: terraform-example.com
resources:
example:
type: alicloud:vpc:DhcpOptionsSet
properties:
dhcpOptionsSetName: ${name}
dhcpOptionsSetDescription: ${name}
domainName: ${domain}
domainNameServers: 100.100.2.136
Import
VPC Dhcp Options Set can be imported using the id, e.g.
$ pulumi import alicloud:vpc/dhcpOptionsSet:DhcpOptionsSet example <id>
Properties
Field 'associate_vpcs' has been deprecated from provider version 1.153.0 and it will be removed in the future version. Please use the new resource 'alicloud_vpc_dhcp_options_set_attachment' to attach DhcpOptionsSet and Vpc. See associate_vpcs
below.
The description can be blank or contain 1 to 256 characters. It must start with a letter or Chinese character but cannot start with http:// or https://.
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.
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.
The DNS server IP addresses. Up to four DNS server IP addresses can be specified. IP addresses must be separated with commas (,).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.
The lease time of the IPv6 DHCP option set.When the lease time is set to hours: Unit: h. Value range: 24h ~ 1176h,87600h ~ 175200h. Default value: 87600h.When the lease time is set to day: Unit: d. Value range: 1d ~ 49d,3650d ~ 7300d. Default value: 3650d.
The ID of the resource group.