VpcDhcpOptions class

Provides a VPC DHCP Options resource.

Example Usage

Basic usage:

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const dnsResolver = new aws.ec2.VpcDhcpOptions("dns_resolver", {domainNameServers: [
    "8.8.8.8",
    "8.8.4.4",
]});
import pulumi
import pulumi_aws as aws

dns_resolver = aws.ec2.VpcDhcpOptions("dns_resolver", domain_name_servers=[
    "8.8.8.8",
    "8.8.4.4",
])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var dnsResolver = new Aws.Ec2.VpcDhcpOptions("dns_resolver", new()
    {
        DomainNameServers = new[]
        {
            "8.8.8.8",
            "8.8.4.4",
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/ec2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ec2.NewVpcDhcpOptions(ctx, "dns_resolver", &ec2.VpcDhcpOptionsArgs{
			DomainNameServers: pulumi.StringArray{
				pulumi.String("8.8.8.8"),
				pulumi.String("8.8.4.4"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_ec2_vpcdhcpoptions" "dns_resolver" {
  domain_name_servers = ["8.8.8.8", "8.8.4.4"]
}
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.ArrayList;
import java.util.Arrays;
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());

    }
}
resources:
  dnsResolver:
    type: aws:ec2:VpcDhcpOptions
    name: dns_resolver
    properties:
      domainNameServers:
        - 8.8.8.8
        - 8.8.4.4

Full usage:

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",
    ],
    ipv6AddressPreferredLeaseTime: "1440",
    ntpServers: ["127.0.0.1"],
    netbiosNameServers: ["127.0.0.1"],
    netbiosNodeType: "2",
    tags: {
        Name: "foo-name",
    },
});
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",
    ],
    ipv6_address_preferred_lease_time="1440",
    ntp_servers=["127.0.0.1"],
    netbios_name_servers=["127.0.0.1"],
    netbios_node_type="2",
    tags={
        "Name": "foo-name",
    })
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",
        },
        Ipv6AddressPreferredLeaseTime = "1440",
        NtpServers = new[]
        {
            "127.0.0.1",
        },
        NetbiosNameServers = new[]
        {
            "127.0.0.1",
        },
        NetbiosNodeType = "2",
        Tags =
        {
            { "Name", "foo-name" },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/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"),
			},
			Ipv6AddressPreferredLeaseTime: pulumi.String("1440"),
			NtpServers: pulumi.StringArray{
				pulumi.String("127.0.0.1"),
			},
			NetbiosNameServers: pulumi.StringArray{
				pulumi.String("127.0.0.1"),
			},
			NetbiosNodeType: pulumi.String("2"),
			Tags: pulumi.StringMap{
				"Name": pulumi.String("foo-name"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_ec2_vpcdhcpoptions" "foo" {
  domain_name                       = "service.consul"
  domain_name_servers               = ["127.0.0.1", "10.0.0.2"]
  ipv6_address_preferred_lease_time = 1440
  ntp_servers                       = ["127.0.0.1"]
  netbios_name_servers              = ["127.0.0.1"]
  netbios_node_type                 = 2
  tags = {
    "Name" = "foo-name"
  }
}
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.ArrayList;
import java.util.Arrays;
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")
            .ipv6AddressPreferredLeaseTime("1440")
            .ntpServers("127.0.0.1")
            .netbiosNameServers("127.0.0.1")
            .netbiosNodeType("2")
            .tags(Map.of("Name", "foo-name"))
            .build());

    }
}
resources:
  foo:
    type: aws:ec2:VpcDhcpOptions
    properties:
      domainName: service.consul
      domainNameServers:
        - 127.0.0.1
        - 10.0.0.2
      ipv6AddressPreferredLeaseTime: 1440
      ntpServers:
        - 127.0.0.1
      netbiosNameServers:
        - 127.0.0.1
      netbiosNodeType: 2
      tags:
        Name: foo-name

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

Constructors

VpcDhcpOptions(String name, {VpcDhcpOptionsArgs? args, CustomResourceOptions? options})
Creates a new VpcDhcpOptions. name The Pulumi resource name. args Arguments used to configure this VpcDhcpOptions. The set of arguments for VpcDhcpOptions. options Resource options controlling this resource's behavior.
VpcDhcpOptions.reference(String urn)
Creates a typed reference to an existing VpcDhcpOptions resource.

Properties

arn ↔ Output<String>
The ARN of the DHCP Options Set.
latefinal
childResources → Set<Resource>
finalinherited
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
domainName ↔ Output<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.
latefinal
domainNameServers ↔ Output<List<String>?>
List of name servers to configure in /etc/resolv.conf. If you want to use the default AWS nameservers you should set this to AmazonProvidedDNS.
latefinal
hashCode → int
The hash code for this object.
no setterinherited
id ↔ Output<String>
getter/setter pairinherited
ipv6AddressPreferredLeaseTime ↔ Output<String?>
How frequently, in seconds, a running instance with an IPv6 assigned to it goes through DHCPv6 lease renewal. Acceptable values are between 140 and 2147483647 (approximately 68 years). If no value is entered, the default lease time is 140 seconds. If you use long-term addressing for EC2 instances, you can increase the lease time and avoid frequent lease renewal requests. Lease renewal typically occurs when half of the lease time has elapsed.
latefinal
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
netbiosNameServers ↔ Output<List<String>?>
List of NETBIOS name servers.
latefinal
netbiosNodeType ↔ Output<String?>
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.
latefinal
ntpServers ↔ Output<List<String>?>
List of NTP servers to configure.
latefinal
ownerId ↔ Output<String>
The ID of the AWS account that owns the DHCP options set.
latefinal
region ↔ Output<String>
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
tags ↔ Output<Map<String, String>?>
A map of tags to assign to the resource. .If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
latefinal
tagsAll ↔ Output<Map<String, String>>
A map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.
latefinal
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
urn ↔ Output<String>
latefinalinherited

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {VpcDhcpOptionsState? state, CustomResourceOptions? options}) → VpcDhcpOptions
Gets an existing VpcDhcpOptions resource's state with the given name and id.