Try AWS Native preview for resources not in the classic version.
aws.ec2.VpcDhcpOptions
Explore with Pulumi AI
Try AWS Native preview for resources not in the classic version.
Provides a VPC DHCP Options resource.
Remarks
- Notice that all arguments are optional but you have to specify at least one argument.
domain_name_servers
,netbios_name_servers
,ntp_servers
are limited by AWS to maximum four servers only.- To actually use the DHCP Options Set you need to associate it to a VPC using
aws.ec2.VpcDhcpOptionsAssociation
. - If you delete a DHCP Options Set, all VPCs using it will be associated to AWS’s
default
DHCP Option Set. - In most cases unless you’re configuring your own DNS you’ll want to set
domain_name_servers
toAmazonProvidedDNS
.
Example Usage
Basic usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var dnsResolver = new Aws.Ec2.VpcDhcpOptions("dnsResolver", new()
{
DomainNameServers = new[]
{
"8.8.8.8",
"8.8.4.4",
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ec2.NewVpcDhcpOptions(ctx, "dnsResolver", &ec2.VpcDhcpOptionsArgs{
DomainNameServers: pulumi.StringArray{
pulumi.String("8.8.8.8"),
pulumi.String("8.8.4.4"),
},
})
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.aws.ec2.VpcDhcpOptions;
import com.pulumi.aws.ec2.VpcDhcpOptionsArgs;
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) {
var dnsResolver = new VpcDhcpOptions("dnsResolver", VpcDhcpOptionsArgs.builder()
.domainNameServers(
"8.8.8.8",
"8.8.4.4")
.build());
}
}
import pulumi
import pulumi_aws as aws
dns_resolver = aws.ec2.VpcDhcpOptions("dnsResolver", domain_name_servers=[
"8.8.8.8",
"8.8.4.4",
])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const dnsResolver = new aws.ec2.VpcDhcpOptions("dnsResolver", {domainNameServers: [
"8.8.8.8",
"8.8.4.4",
]});
resources:
dnsResolver:
type: aws:ec2:VpcDhcpOptions
properties:
domainNameServers:
- 8.8.8.8
- 8.8.4.4
Full usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var foo = new Aws.Ec2.VpcDhcpOptions("foo", new()
{
DomainName = "service.consul",
DomainNameServers = new[]
{
"127.0.0.1",
"10.0.0.2",
},
NetbiosNameServers = new[]
{
"127.0.0.1",
},
NetbiosNodeType = "2",
NtpServers = new[]
{
"127.0.0.1",
},
Tags =
{
{ "Name", "foo-name" },
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ec2.NewVpcDhcpOptions(ctx, "foo", &ec2.VpcDhcpOptionsArgs{
DomainName: pulumi.String("service.consul"),
DomainNameServers: pulumi.StringArray{
pulumi.String("127.0.0.1"),
pulumi.String("10.0.0.2"),
},
NetbiosNameServers: pulumi.StringArray{
pulumi.String("127.0.0.1"),
},
NetbiosNodeType: pulumi.String("2"),
NtpServers: pulumi.StringArray{
pulumi.String("127.0.0.1"),
},
Tags: pulumi.StringMap{
"Name": pulumi.String("foo-name"),
},
})
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.aws.ec2.VpcDhcpOptions;
import com.pulumi.aws.ec2.VpcDhcpOptionsArgs;
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) {
var foo = new VpcDhcpOptions("foo", VpcDhcpOptionsArgs.builder()
.domainName("service.consul")
.domainNameServers(
"127.0.0.1",
"10.0.0.2")
.netbiosNameServers("127.0.0.1")
.netbiosNodeType(2)
.ntpServers("127.0.0.1")
.tags(Map.of("Name", "foo-name"))
.build());
}
}
import pulumi
import pulumi_aws as aws
foo = aws.ec2.VpcDhcpOptions("foo",
domain_name="service.consul",
domain_name_servers=[
"127.0.0.1",
"10.0.0.2",
],
netbios_name_servers=["127.0.0.1"],
netbios_node_type="2",
ntp_servers=["127.0.0.1"],
tags={
"Name": "foo-name",
})
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const foo = new aws.ec2.VpcDhcpOptions("foo", {
domainName: "service.consul",
domainNameServers: [
"127.0.0.1",
"10.0.0.2",
],
netbiosNameServers: ["127.0.0.1"],
netbiosNodeType: "2",
ntpServers: ["127.0.0.1"],
tags: {
Name: "foo-name",
},
});
resources:
foo:
type: aws:ec2:VpcDhcpOptions
properties:
domainName: service.consul
domainNameServers:
- 127.0.0.1
- 10.0.0.2
netbiosNameServers:
- 127.0.0.1
netbiosNodeType: 2
ntpServers:
- 127.0.0.1
tags:
Name: foo-name
Create VpcDhcpOptions Resource
new VpcDhcpOptions(name: string, args?: VpcDhcpOptionsArgs, opts?: CustomResourceOptions);
@overload
def VpcDhcpOptions(resource_name: str,
opts: Optional[ResourceOptions] = None,
domain_name: Optional[str] = None,
domain_name_servers: Optional[Sequence[str]] = None,
netbios_name_servers: Optional[Sequence[str]] = None,
netbios_node_type: Optional[str] = None,
ntp_servers: Optional[Sequence[str]] = None,
tags: Optional[Mapping[str, str]] = None)
@overload
def VpcDhcpOptions(resource_name: str,
args: Optional[VpcDhcpOptionsArgs] = None,
opts: Optional[ResourceOptions] = None)
func NewVpcDhcpOptions(ctx *Context, name string, args *VpcDhcpOptionsArgs, opts ...ResourceOption) (*VpcDhcpOptions, error)
public VpcDhcpOptions(string name, VpcDhcpOptionsArgs? args = null, CustomResourceOptions? opts = null)
public VpcDhcpOptions(String name, VpcDhcpOptionsArgs args)
public VpcDhcpOptions(String name, VpcDhcpOptionsArgs args, CustomResourceOptions options)
type: aws:ec2:VpcDhcpOptions
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VpcDhcpOptionsArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args VpcDhcpOptionsArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args VpcDhcpOptionsArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VpcDhcpOptionsArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args VpcDhcpOptionsArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
VpcDhcpOptions Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The VpcDhcpOptions resource accepts the following input properties:
- Domain
Name string the suffix domain name to use by default when resolving non Fully Qualified Domain Names. In other words, this is what ends up being the
search
value in the/etc/resolv.conf
file.- Domain
Name List<string>Servers List of name servers to configure in
/etc/resolv.conf
. If you want to use the default AWS nameservers you should set this toAmazonProvidedDNS
.- Netbios
Name List<string>Servers List of NETBIOS name servers.
- Netbios
Node stringType The NetBIOS node type (1, 2, 4, or 8). AWS recommends to specify 2 since broadcast and multicast are not supported in their network. For more information about these node types, see RFC 2132.
- Ntp
Servers List<string> List of NTP servers to configure.
- Dictionary<string, string>
A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- Domain
Name string the suffix domain name to use by default when resolving non Fully Qualified Domain Names. In other words, this is what ends up being the
search
value in the/etc/resolv.conf
file.- Domain
Name []stringServers List of name servers to configure in
/etc/resolv.conf
. If you want to use the default AWS nameservers you should set this toAmazonProvidedDNS
.- Netbios
Name []stringServers List of NETBIOS name servers.
- Netbios
Node stringType The NetBIOS node type (1, 2, 4, or 8). AWS recommends to specify 2 since broadcast and multicast are not supported in their network. For more information about these node types, see RFC 2132.
- Ntp
Servers []string List of NTP servers to configure.
- map[string]string
A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- domain
Name String the suffix domain name to use by default when resolving non Fully Qualified Domain Names. In other words, this is what ends up being the
search
value in the/etc/resolv.conf
file.- domain
Name List<String>Servers List of name servers to configure in
/etc/resolv.conf
. If you want to use the default AWS nameservers you should set this toAmazonProvidedDNS
.- netbios
Name List<String>Servers List of NETBIOS name servers.
- netbios
Node StringType The NetBIOS node type (1, 2, 4, or 8). AWS recommends to specify 2 since broadcast and multicast are not supported in their network. For more information about these node types, see RFC 2132.
- ntp
Servers List<String> List of NTP servers to configure.
- Map<String,String>
A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- domain
Name string the suffix domain name to use by default when resolving non Fully Qualified Domain Names. In other words, this is what ends up being the
search
value in the/etc/resolv.conf
file.- domain
Name string[]Servers List of name servers to configure in
/etc/resolv.conf
. If you want to use the default AWS nameservers you should set this toAmazonProvidedDNS
.- netbios
Name string[]Servers List of NETBIOS name servers.
- netbios
Node stringType The NetBIOS node type (1, 2, 4, or 8). AWS recommends to specify 2 since broadcast and multicast are not supported in their network. For more information about these node types, see RFC 2132.
- ntp
Servers string[] List of NTP servers to configure.
- {[key: string]: string}
A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- domain_
name str the suffix domain name to use by default when resolving non Fully Qualified Domain Names. In other words, this is what ends up being the
search
value in the/etc/resolv.conf
file.- domain_
name_ Sequence[str]servers List of name servers to configure in
/etc/resolv.conf
. If you want to use the default AWS nameservers you should set this toAmazonProvidedDNS
.- netbios_
name_ Sequence[str]servers List of NETBIOS name servers.
- netbios_
node_ strtype The NetBIOS node type (1, 2, 4, or 8). AWS recommends to specify 2 since broadcast and multicast are not supported in their network. For more information about these node types, see RFC 2132.
- ntp_
servers Sequence[str] List of NTP servers to configure.
- Mapping[str, str]
A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- domain
Name String the suffix domain name to use by default when resolving non Fully Qualified Domain Names. In other words, this is what ends up being the
search
value in the/etc/resolv.conf
file.- domain
Name List<String>Servers List of name servers to configure in
/etc/resolv.conf
. If you want to use the default AWS nameservers you should set this toAmazonProvidedDNS
.- netbios
Name List<String>Servers List of NETBIOS name servers.
- netbios
Node StringType The NetBIOS node type (1, 2, 4, or 8). AWS recommends to specify 2 since broadcast and multicast are not supported in their network. For more information about these node types, see RFC 2132.
- ntp
Servers List<String> List of NTP servers to configure.
- Map<String>
A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Outputs
All input properties are implicitly available as output properties. Additionally, the VpcDhcpOptions resource produces the following output properties:
- Arn string
The ARN of the DHCP Options Set.
- Id string
The provider-assigned unique ID for this managed resource.
- Owner
Id string The ID of the AWS account that owns the DHCP options set.
- Dictionary<string, string>
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
- Arn string
The ARN of the DHCP Options Set.
- Id string
The provider-assigned unique ID for this managed resource.
- Owner
Id string The ID of the AWS account that owns the DHCP options set.
- map[string]string
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
- arn String
The ARN of the DHCP Options Set.
- id String
The provider-assigned unique ID for this managed resource.
- owner
Id String The ID of the AWS account that owns the DHCP options set.
- Map<String,String>
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
- arn string
The ARN of the DHCP Options Set.
- id string
The provider-assigned unique ID for this managed resource.
- owner
Id string The ID of the AWS account that owns the DHCP options set.
- {[key: string]: string}
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
- arn str
The ARN of the DHCP Options Set.
- id str
The provider-assigned unique ID for this managed resource.
- owner_
id str The ID of the AWS account that owns the DHCP options set.
- Mapping[str, str]
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
- arn String
The ARN of the DHCP Options Set.
- id String
The provider-assigned unique ID for this managed resource.
- owner
Id String The ID of the AWS account that owns the DHCP options set.
- Map<String>
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
Look up Existing VpcDhcpOptions Resource
Get an existing VpcDhcpOptions resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: VpcDhcpOptionsState, opts?: CustomResourceOptions): VpcDhcpOptions
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
arn: Optional[str] = None,
domain_name: Optional[str] = None,
domain_name_servers: Optional[Sequence[str]] = None,
netbios_name_servers: Optional[Sequence[str]] = None,
netbios_node_type: Optional[str] = None,
ntp_servers: Optional[Sequence[str]] = None,
owner_id: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
tags_all: Optional[Mapping[str, str]] = None) -> VpcDhcpOptions
func GetVpcDhcpOptions(ctx *Context, name string, id IDInput, state *VpcDhcpOptionsState, opts ...ResourceOption) (*VpcDhcpOptions, error)
public static VpcDhcpOptions Get(string name, Input<string> id, VpcDhcpOptionsState? state, CustomResourceOptions? opts = null)
public static VpcDhcpOptions get(String name, Output<String> id, VpcDhcpOptionsState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Arn string
The ARN of the DHCP Options Set.
- Domain
Name string the suffix domain name to use by default when resolving non Fully Qualified Domain Names. In other words, this is what ends up being the
search
value in the/etc/resolv.conf
file.- Domain
Name List<string>Servers List of name servers to configure in
/etc/resolv.conf
. If you want to use the default AWS nameservers you should set this toAmazonProvidedDNS
.- Netbios
Name List<string>Servers List of NETBIOS name servers.
- Netbios
Node stringType The NetBIOS node type (1, 2, 4, or 8). AWS recommends to specify 2 since broadcast and multicast are not supported in their network. For more information about these node types, see RFC 2132.
- Ntp
Servers List<string> List of NTP servers to configure.
- Owner
Id string The ID of the AWS account that owns the DHCP options set.
- Dictionary<string, string>
A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- Dictionary<string, string>
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
- Arn string
The ARN of the DHCP Options Set.
- Domain
Name string the suffix domain name to use by default when resolving non Fully Qualified Domain Names. In other words, this is what ends up being the
search
value in the/etc/resolv.conf
file.- Domain
Name []stringServers List of name servers to configure in
/etc/resolv.conf
. If you want to use the default AWS nameservers you should set this toAmazonProvidedDNS
.- Netbios
Name []stringServers List of NETBIOS name servers.
- Netbios
Node stringType The NetBIOS node type (1, 2, 4, or 8). AWS recommends to specify 2 since broadcast and multicast are not supported in their network. For more information about these node types, see RFC 2132.
- Ntp
Servers []string List of NTP servers to configure.
- Owner
Id string The ID of the AWS account that owns the DHCP options set.
- map[string]string
A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- map[string]string
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
- arn String
The ARN of the DHCP Options Set.
- domain
Name String the suffix domain name to use by default when resolving non Fully Qualified Domain Names. In other words, this is what ends up being the
search
value in the/etc/resolv.conf
file.- domain
Name List<String>Servers List of name servers to configure in
/etc/resolv.conf
. If you want to use the default AWS nameservers you should set this toAmazonProvidedDNS
.- netbios
Name List<String>Servers List of NETBIOS name servers.
- netbios
Node StringType The NetBIOS node type (1, 2, 4, or 8). AWS recommends to specify 2 since broadcast and multicast are not supported in their network. For more information about these node types, see RFC 2132.
- ntp
Servers List<String> List of NTP servers to configure.
- owner
Id String The ID of the AWS account that owns the DHCP options set.
- Map<String,String>
A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- Map<String,String>
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
- arn string
The ARN of the DHCP Options Set.
- domain
Name string the suffix domain name to use by default when resolving non Fully Qualified Domain Names. In other words, this is what ends up being the
search
value in the/etc/resolv.conf
file.- domain
Name string[]Servers List of name servers to configure in
/etc/resolv.conf
. If you want to use the default AWS nameservers you should set this toAmazonProvidedDNS
.- netbios
Name string[]Servers List of NETBIOS name servers.
- netbios
Node stringType The NetBIOS node type (1, 2, 4, or 8). AWS recommends to specify 2 since broadcast and multicast are not supported in their network. For more information about these node types, see RFC 2132.
- ntp
Servers string[] List of NTP servers to configure.
- owner
Id string The ID of the AWS account that owns the DHCP options set.
- {[key: string]: string}
A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- {[key: string]: string}
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
- arn str
The ARN of the DHCP Options Set.
- domain_
name str the suffix domain name to use by default when resolving non Fully Qualified Domain Names. In other words, this is what ends up being the
search
value in the/etc/resolv.conf
file.- domain_
name_ Sequence[str]servers List of name servers to configure in
/etc/resolv.conf
. If you want to use the default AWS nameservers you should set this toAmazonProvidedDNS
.- netbios_
name_ Sequence[str]servers List of NETBIOS name servers.
- netbios_
node_ strtype The NetBIOS node type (1, 2, 4, or 8). AWS recommends to specify 2 since broadcast and multicast are not supported in their network. For more information about these node types, see RFC 2132.
- ntp_
servers Sequence[str] List of NTP servers to configure.
- owner_
id str The ID of the AWS account that owns the DHCP options set.
- Mapping[str, str]
A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- Mapping[str, str]
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
- arn String
The ARN of the DHCP Options Set.
- domain
Name String the suffix domain name to use by default when resolving non Fully Qualified Domain Names. In other words, this is what ends up being the
search
value in the/etc/resolv.conf
file.- domain
Name List<String>Servers List of name servers to configure in
/etc/resolv.conf
. If you want to use the default AWS nameservers you should set this toAmazonProvidedDNS
.- netbios
Name List<String>Servers List of NETBIOS name servers.
- netbios
Node StringType The NetBIOS node type (1, 2, 4, or 8). AWS recommends to specify 2 since broadcast and multicast are not supported in their network. For more information about these node types, see RFC 2132.
- ntp
Servers List<String> List of NTP servers to configure.
- owner
Id String The ID of the AWS account that owns the DHCP options set.
- Map<String>
A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- Map<String>
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
Import
Using pulumi import
, import VPC DHCP Options using the DHCP Options id
. For example:
$ pulumi import aws:ec2/vpcDhcpOptions:VpcDhcpOptions my_options dopt-d9070ebb
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
aws
Terraform Provider.
Try AWS Native preview for resources not in the classic version.