1. Packages
  2. AWS Classic
  3. API Docs
  4. ec2
  5. getVpcDhcpOptions

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.28.1 published on Thursday, Mar 28, 2024 by Pulumi

aws.ec2.getVpcDhcpOptions

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.28.1 published on Thursday, Mar 28, 2024 by Pulumi

    Retrieve information about an EC2 DHCP Options configuration.

    Example Usage

    Lookup by DHCP Options ID

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = aws.ec2.getVpcDhcpOptions({
        dhcpOptionsId: "dopts-12345678",
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.ec2.get_vpc_dhcp_options(dhcp_options_id="dopts-12345678")
    
    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.LookupVpcDhcpOptions(ctx, &ec2.LookupVpcDhcpOptionsArgs{
    			DhcpOptionsId: pulumi.StringRef("dopts-12345678"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Aws.Ec2.GetVpcDhcpOptions.Invoke(new()
        {
            DhcpOptionsId = "dopts-12345678",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.ec2.Ec2Functions;
    import com.pulumi.aws.ec2.inputs.GetVpcDhcpOptionsArgs;
    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 example = Ec2Functions.getVpcDhcpOptions(GetVpcDhcpOptionsArgs.builder()
                .dhcpOptionsId("dopts-12345678")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: aws:ec2:getVpcDhcpOptions
          Arguments:
            dhcpOptionsId: dopts-12345678
    

    Lookup by Filter

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = aws.ec2.getVpcDhcpOptions({
        filters: [
            {
                name: "key",
                values: ["domain-name"],
            },
            {
                name: "value",
                values: ["example.com"],
            },
        ],
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.ec2.get_vpc_dhcp_options(filters=[
        aws.ec2.GetVpcDhcpOptionsFilterArgs(
            name="key",
            values=["domain-name"],
        ),
        aws.ec2.GetVpcDhcpOptionsFilterArgs(
            name="value",
            values=["example.com"],
        ),
    ])
    
    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.LookupVpcDhcpOptions(ctx, &ec2.LookupVpcDhcpOptionsArgs{
    			Filters: []ec2.GetVpcDhcpOptionsFilter{
    				{
    					Name: "key",
    					Values: []string{
    						"domain-name",
    					},
    				},
    				{
    					Name: "value",
    					Values: []string{
    						"example.com",
    					},
    				},
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Aws.Ec2.GetVpcDhcpOptions.Invoke(new()
        {
            Filters = new[]
            {
                new Aws.Ec2.Inputs.GetVpcDhcpOptionsFilterInputArgs
                {
                    Name = "key",
                    Values = new[]
                    {
                        "domain-name",
                    },
                },
                new Aws.Ec2.Inputs.GetVpcDhcpOptionsFilterInputArgs
                {
                    Name = "value",
                    Values = new[]
                    {
                        "example.com",
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.ec2.Ec2Functions;
    import com.pulumi.aws.ec2.inputs.GetVpcDhcpOptionsArgs;
    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 example = Ec2Functions.getVpcDhcpOptions(GetVpcDhcpOptionsArgs.builder()
                .filters(            
                    GetVpcDhcpOptionsFilterArgs.builder()
                        .name("key")
                        .values("domain-name")
                        .build(),
                    GetVpcDhcpOptionsFilterArgs.builder()
                        .name("value")
                        .values("example.com")
                        .build())
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: aws:ec2:getVpcDhcpOptions
          Arguments:
            filters:
              - name: key
                values:
                  - domain-name
              - name: value
                values:
                  - example.com
    

    Using getVpcDhcpOptions

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getVpcDhcpOptions(args: GetVpcDhcpOptionsArgs, opts?: InvokeOptions): Promise<GetVpcDhcpOptionsResult>
    function getVpcDhcpOptionsOutput(args: GetVpcDhcpOptionsOutputArgs, opts?: InvokeOptions): Output<GetVpcDhcpOptionsResult>
    def get_vpc_dhcp_options(dhcp_options_id: Optional[str] = None,
                             filters: Optional[Sequence[GetVpcDhcpOptionsFilter]] = None,
                             tags: Optional[Mapping[str, str]] = None,
                             opts: Optional[InvokeOptions] = None) -> GetVpcDhcpOptionsResult
    def get_vpc_dhcp_options_output(dhcp_options_id: Optional[pulumi.Input[str]] = None,
                             filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetVpcDhcpOptionsFilterArgs]]]] = None,
                             tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                             opts: Optional[InvokeOptions] = None) -> Output[GetVpcDhcpOptionsResult]
    func LookupVpcDhcpOptions(ctx *Context, args *LookupVpcDhcpOptionsArgs, opts ...InvokeOption) (*LookupVpcDhcpOptionsResult, error)
    func LookupVpcDhcpOptionsOutput(ctx *Context, args *LookupVpcDhcpOptionsOutputArgs, opts ...InvokeOption) LookupVpcDhcpOptionsResultOutput

    > Note: This function is named LookupVpcDhcpOptions in the Go SDK.

    public static class GetVpcDhcpOptions 
    {
        public static Task<GetVpcDhcpOptionsResult> InvokeAsync(GetVpcDhcpOptionsArgs args, InvokeOptions? opts = null)
        public static Output<GetVpcDhcpOptionsResult> Invoke(GetVpcDhcpOptionsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetVpcDhcpOptionsResult> getVpcDhcpOptions(GetVpcDhcpOptionsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: aws:ec2/getVpcDhcpOptions:getVpcDhcpOptions
      arguments:
        # arguments dictionary

    The following arguments are supported:

    DhcpOptionsId string
    EC2 DHCP Options ID.
    Filters List<GetVpcDhcpOptionsFilter>
    List of custom filters as described below.
    Tags Dictionary<string, string>
    Map of tags assigned to the resource.
    DhcpOptionsId string
    EC2 DHCP Options ID.
    Filters []GetVpcDhcpOptionsFilter
    List of custom filters as described below.
    Tags map[string]string
    Map of tags assigned to the resource.
    dhcpOptionsId String
    EC2 DHCP Options ID.
    filters List<GetVpcDhcpOptionsFilter>
    List of custom filters as described below.
    tags Map<String,String>
    Map of tags assigned to the resource.
    dhcpOptionsId string
    EC2 DHCP Options ID.
    filters GetVpcDhcpOptionsFilter[]
    List of custom filters as described below.
    tags {[key: string]: string}
    Map of tags assigned to the resource.
    dhcp_options_id str
    EC2 DHCP Options ID.
    filters Sequence[GetVpcDhcpOptionsFilter]
    List of custom filters as described below.
    tags Mapping[str, str]
    Map of tags assigned to the resource.
    dhcpOptionsId String
    EC2 DHCP Options ID.
    filters List<Property Map>
    List of custom filters as described below.
    tags Map<String>
    Map of tags assigned to the resource.

    getVpcDhcpOptions Result

    The following output properties are available:

    Arn string
    ARN of the DHCP Options Set.
    DhcpOptionsId string
    EC2 DHCP Options ID
    DomainName string
    Suffix domain name to used when resolving non Fully Qualified Domain NamesE.g., the search value in the /etc/resolv.conf file.
    DomainNameServers List<string>
    List of name servers.
    Id string
    The provider-assigned unique ID for this managed resource.
    NetbiosNameServers List<string>
    List of NETBIOS name servers.
    NetbiosNodeType string
    NetBIOS node type (1, 2, 4, or 8). For more information about these node types, see RFC 2132.
    NtpServers List<string>
    List of NTP servers.
    OwnerId string
    ID of the AWS account that owns the DHCP options set.
    Tags Dictionary<string, string>
    Map of tags assigned to the resource.
    Filters List<GetVpcDhcpOptionsFilter>
    Arn string
    ARN of the DHCP Options Set.
    DhcpOptionsId string
    EC2 DHCP Options ID
    DomainName string
    Suffix domain name to used when resolving non Fully Qualified Domain NamesE.g., the search value in the /etc/resolv.conf file.
    DomainNameServers []string
    List of name servers.
    Id string
    The provider-assigned unique ID for this managed resource.
    NetbiosNameServers []string
    List of NETBIOS name servers.
    NetbiosNodeType string
    NetBIOS node type (1, 2, 4, or 8). For more information about these node types, see RFC 2132.
    NtpServers []string
    List of NTP servers.
    OwnerId string
    ID of the AWS account that owns the DHCP options set.
    Tags map[string]string
    Map of tags assigned to the resource.
    Filters []GetVpcDhcpOptionsFilter
    arn String
    ARN of the DHCP Options Set.
    dhcpOptionsId String
    EC2 DHCP Options ID
    domainName String
    Suffix domain name to used when resolving non Fully Qualified Domain NamesE.g., the search value in the /etc/resolv.conf file.
    domainNameServers List<String>
    List of name servers.
    id String
    The provider-assigned unique ID for this managed resource.
    netbiosNameServers List<String>
    List of NETBIOS name servers.
    netbiosNodeType String
    NetBIOS node type (1, 2, 4, or 8). For more information about these node types, see RFC 2132.
    ntpServers List<String>
    List of NTP servers.
    ownerId String
    ID of the AWS account that owns the DHCP options set.
    tags Map<String,String>
    Map of tags assigned to the resource.
    filters List<GetVpcDhcpOptionsFilter>
    arn string
    ARN of the DHCP Options Set.
    dhcpOptionsId string
    EC2 DHCP Options ID
    domainName string
    Suffix domain name to used when resolving non Fully Qualified Domain NamesE.g., the search value in the /etc/resolv.conf file.
    domainNameServers string[]
    List of name servers.
    id string
    The provider-assigned unique ID for this managed resource.
    netbiosNameServers string[]
    List of NETBIOS name servers.
    netbiosNodeType string
    NetBIOS node type (1, 2, 4, or 8). For more information about these node types, see RFC 2132.
    ntpServers string[]
    List of NTP servers.
    ownerId string
    ID of the AWS account that owns the DHCP options set.
    tags {[key: string]: string}
    Map of tags assigned to the resource.
    filters GetVpcDhcpOptionsFilter[]
    arn str
    ARN of the DHCP Options Set.
    dhcp_options_id str
    EC2 DHCP Options ID
    domain_name str
    Suffix domain name to used when resolving non Fully Qualified Domain NamesE.g., the search value in the /etc/resolv.conf file.
    domain_name_servers Sequence[str]
    List of name servers.
    id str
    The provider-assigned unique ID for this managed resource.
    netbios_name_servers Sequence[str]
    List of NETBIOS name servers.
    netbios_node_type str
    NetBIOS node type (1, 2, 4, or 8). For more information about these node types, see RFC 2132.
    ntp_servers Sequence[str]
    List of NTP servers.
    owner_id str
    ID of the AWS account that owns the DHCP options set.
    tags Mapping[str, str]
    Map of tags assigned to the resource.
    filters Sequence[GetVpcDhcpOptionsFilter]
    arn String
    ARN of the DHCP Options Set.
    dhcpOptionsId String
    EC2 DHCP Options ID
    domainName String
    Suffix domain name to used when resolving non Fully Qualified Domain NamesE.g., the search value in the /etc/resolv.conf file.
    domainNameServers List<String>
    List of name servers.
    id String
    The provider-assigned unique ID for this managed resource.
    netbiosNameServers List<String>
    List of NETBIOS name servers.
    netbiosNodeType String
    NetBIOS node type (1, 2, 4, or 8). For more information about these node types, see RFC 2132.
    ntpServers List<String>
    List of NTP servers.
    ownerId String
    ID of the AWS account that owns the DHCP options set.
    tags Map<String>
    Map of tags assigned to the resource.
    filters List<Property Map>

    Supporting Types

    GetVpcDhcpOptionsFilter

    Name string
    Name of the field to filter.
    Values List<string>
    Set of values for filtering.
    Name string
    Name of the field to filter.
    Values []string
    Set of values for filtering.
    name String
    Name of the field to filter.
    values List<String>
    Set of values for filtering.
    name string
    Name of the field to filter.
    values string[]
    Set of values for filtering.
    name str
    Name of the field to filter.
    values Sequence[str]
    Set of values for filtering.
    name String
    Name of the field to filter.
    values List<String>
    Set of values for filtering.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.28.1 published on Thursday, Mar 28, 2024 by Pulumi