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

com.pulumi.aws.route53.kotlin.ResolverConfig.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 6.57.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.aws.route53.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.String
import kotlin.Suppress
import kotlin.Unit

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

    public var args: ResolverConfigArgs = ResolverConfigArgs()

    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 ResolverConfigArgsBuilder.() -> Unit) {
        val builder = ResolverConfigArgsBuilder()
        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(): ResolverConfig {
        val builtJavaResource = com.pulumi.aws.route53.ResolverConfig(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return ResolverConfig(builtJavaResource)
    }
}

/**
 * Provides a Route 53 Resolver config resource.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const example = new aws.ec2.Vpc("example", {
 *     cidrBlock: "10.0.0.0/16",
 *     enableDnsSupport: true,
 *     enableDnsHostnames: true,
 * });
 * const exampleResolverConfig = new aws.route53.ResolverConfig("example", {
 *     resourceId: example.id,
 *     autodefinedReverseFlag: "DISABLE",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * example = aws.ec2.Vpc("example",
 *     cidr_block="10.0.0.0/16",
 *     enable_dns_support=True,
 *     enable_dns_hostnames=True)
 * example_resolver_config = aws.route53.ResolverConfig("example",
 *     resource_id=example.id,
 *     autodefined_reverse_flag="DISABLE")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Aws.Ec2.Vpc("example", new()
 *     {
 *         CidrBlock = "10.0.0.0/16",
 *         EnableDnsSupport = true,
 *         EnableDnsHostnames = true,
 *     });
 *     var exampleResolverConfig = new Aws.Route53.ResolverConfig("example", new()
 *     {
 *         ResourceId = example.Id,
 *         AutodefinedReverseFlag = "DISABLE",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/route53"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := ec2.NewVpc(ctx, "example", &ec2.VpcArgs{
 * 			CidrBlock:          pulumi.String("10.0.0.0/16"),
 * 			EnableDnsSupport:   pulumi.Bool(true),
 * 			EnableDnsHostnames: pulumi.Bool(true),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = route53.NewResolverConfig(ctx, "example", &route53.ResolverConfigArgs{
 * 			ResourceId:             example.ID(),
 * 			AutodefinedReverseFlag: pulumi.String("DISABLE"),
 * 		})
 * 		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.Vpc;
 * import com.pulumi.aws.ec2.VpcArgs;
 * import com.pulumi.aws.route53.ResolverConfig;
 * import com.pulumi.aws.route53.ResolverConfigArgs;
 * 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 example = new Vpc("example", VpcArgs.builder()
 *             .cidrBlock("10.0.0.0/16")
 *             .enableDnsSupport(true)
 *             .enableDnsHostnames(true)
 *             .build());
 *         var exampleResolverConfig = new ResolverConfig("exampleResolverConfig", ResolverConfigArgs.builder()
 *             .resourceId(example.id())
 *             .autodefinedReverseFlag("DISABLE")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: aws:ec2:Vpc
 *     properties:
 *       cidrBlock: 10.0.0.0/16
 *       enableDnsSupport: true
 *       enableDnsHostnames: true
 *   exampleResolverConfig:
 *     type: aws:route53:ResolverConfig
 *     name: example
 *     properties:
 *       resourceId: ${example.id}
 *       autodefinedReverseFlag: DISABLE
 * ```
 * 
 * ## Import
 * Using `pulumi import`, import Route 53 Resolver configs using the Route 53 Resolver config ID. For example:
 * ```sh
 * $ pulumi import aws:route53/resolverConfig:ResolverConfig example rslvr-rc-715aa20c73a23da7
 * ```
 */
public class ResolverConfig internal constructor(
    override val javaResource: com.pulumi.aws.route53.ResolverConfig,
) : KotlinCustomResource(javaResource, ResolverConfigMapper) {
    /**
     * Indicates whether or not the Resolver will create autodefined rules for reverse DNS lookups. Valid values: `ENABLE`, `DISABLE`.
     */
    public val autodefinedReverseFlag: Output
        get() = javaResource.autodefinedReverseFlag().applyValue({ args0 -> args0 })

    /**
     * The AWS account ID of the owner of the VPC that this resolver configuration applies to.
     */
    public val ownerId: Output
        get() = javaResource.ownerId().applyValue({ args0 -> args0 })

    /**
     * The ID of the VPC that the configuration is for.
     */
    public val resourceId: Output
        get() = javaResource.resourceId().applyValue({ args0 -> args0 })
}

public object ResolverConfigMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.aws.route53.ResolverConfig::class == javaResource::class

    override fun map(javaResource: Resource): ResolverConfig = ResolverConfig(
        javaResource as
            com.pulumi.aws.route53.ResolverConfig,
    )
}

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy