All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.aws.ec2.kotlin.DefaultVpcDhcpOptions.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.aws.ec2.kotlin

import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.Deprecated
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map

/**
 * Builder for [DefaultVpcDhcpOptions].
 */
@PulumiTagMarker
public class DefaultVpcDhcpOptionsResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: DefaultVpcDhcpOptionsArgs = DefaultVpcDhcpOptionsArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend DefaultVpcDhcpOptionsArgsBuilder.() -> Unit) {
        val builder = DefaultVpcDhcpOptionsArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): DefaultVpcDhcpOptions {
        val builtJavaResource = com.pulumi.aws.ec2.DefaultVpcDhcpOptions(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return DefaultVpcDhcpOptions(builtJavaResource)
    }
}

/**
 * Provides a resource to manage the [default AWS DHCP Options Set](http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_DHCP_Options.html#AmazonDNS)
 * in the current region.
 * Each AWS region comes with a default set of DHCP options.
 * **This is an advanced resource**, and has special caveats to be aware of when
 * using it. Please read this document in its entirety before using this resource.
 * The `aws.ec2.DefaultVpcDhcpOptions` behaves differently from normal resources, in that
 * this provider does not _create_ this resource, but instead "adopts" it
 * into management.
 * ## Example Usage
 * Basic usage with tags:
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const _default = new aws.ec2.DefaultVpcDhcpOptions("default", {tags: {
 *     Name: "Default DHCP Option Set",
 * }});
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * default = aws.ec2.DefaultVpcDhcpOptions("default", tags={
 *     "Name": "Default DHCP Option Set",
 * })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var @default = new Aws.Ec2.DefaultVpcDhcpOptions("default", new()
 *     {
 *         Tags =
 *         {
 *             { "Name", "Default DHCP Option Set" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * 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.NewDefaultVpcDhcpOptions(ctx, "default", &ec2.DefaultVpcDhcpOptionsArgs{
 * 			Tags: pulumi.StringMap{
 * 				"Name": pulumi.String("Default DHCP Option Set"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.aws.ec2.DefaultVpcDhcpOptions;
 * import com.pulumi.aws.ec2.DefaultVpcDhcpOptionsArgs;
 * 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 default_ = new DefaultVpcDhcpOptions("default", DefaultVpcDhcpOptionsArgs.builder()
 *             .tags(Map.of("Name", "Default DHCP Option Set"))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: aws:ec2:DefaultVpcDhcpOptions
 *     properties:
 *       tags:
 *         Name: Default DHCP Option Set
 * ```
 * 
 * ## Import
 * Using `pulumi import`, import VPC DHCP Options using the DHCP Options `id`. For example:
 * ```sh
 * $ pulumi import aws:ec2/defaultVpcDhcpOptions:DefaultVpcDhcpOptions default_options dopt-d9070ebb
 * ```
 */
public class DefaultVpcDhcpOptions internal constructor(
    override val javaResource: com.pulumi.aws.ec2.DefaultVpcDhcpOptions,
) : KotlinCustomResource(javaResource, DefaultVpcDhcpOptionsMapper) {
    /**
     * The ARN of the DHCP Options Set.
     */
    public val arn: Output
        get() = javaResource.arn().applyValue({ args0 -> args0 })

    public val domainName: Output
        get() = javaResource.domainName().applyValue({ args0 -> args0 })

    public val domainNameServers: Output
        get() = javaResource.domainNameServers().applyValue({ args0 -> args0 })

    public val ipv6AddressPreferredLeaseTime: Output
        get() = javaResource.ipv6AddressPreferredLeaseTime().applyValue({ args0 -> args0 })

    /**
     * List of NETBIOS name servers.
     */
    public val netbiosNameServers: Output
        get() = javaResource.netbiosNameServers().applyValue({ args0 -> args0 })

    /**
     * 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](http://www.ietf.org/rfc/rfc2132.txt).
     */
    public val netbiosNodeType: Output
        get() = javaResource.netbiosNodeType().applyValue({ args0 -> args0 })

    public val ntpServers: Output
        get() = javaResource.ntpServers().applyValue({ args0 -> args0 })

    /**
     * The ID of the AWS account that owns the DHCP options set.
     */
    public val ownerId: Output
        get() = javaResource.ownerId().applyValue({ args0 -> args0 })

    /**
     * A map of tags to assign to the resource.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    @Deprecated(
        message = """
  Please use `tags` instead.
  """,
    )
    public val tagsAll: Output>
        get() = javaResource.tagsAll().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })
}

public object DefaultVpcDhcpOptionsMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.aws.ec2.DefaultVpcDhcpOptions::class == javaResource::class

    override fun map(javaResource: Resource): DefaultVpcDhcpOptions =
        DefaultVpcDhcpOptions(javaResource as com.pulumi.aws.ec2.DefaultVpcDhcpOptions)
}

/**
 * @see [DefaultVpcDhcpOptions].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [DefaultVpcDhcpOptions].
 */
public suspend fun defaultVpcDhcpOptions(
    name: String,
    block: suspend DefaultVpcDhcpOptionsResourceBuilder.() -> Unit,
): DefaultVpcDhcpOptions {
    val builder = DefaultVpcDhcpOptionsResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [DefaultVpcDhcpOptions].
 * @param name The _unique_ name of the resulting resource.
 */
public fun defaultVpcDhcpOptions(name: String): DefaultVpcDhcpOptions {
    val builder = DefaultVpcDhcpOptionsResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy