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

com.pulumi.aws.route53.kotlin.ResolverQueryLogConfig.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.Deprecated
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map

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

    public var args: ResolverQueryLogConfigArgs = ResolverQueryLogConfigArgs()

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

/**
 * Provides a Route 53 Resolver query logging configuration resource.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const example = new aws.route53.ResolverQueryLogConfig("example", {
 *     name: "example",
 *     destinationArn: exampleAwsS3Bucket.arn,
 *     tags: {
 *         Environment: "Prod",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * example = aws.route53.ResolverQueryLogConfig("example",
 *     name="example",
 *     destination_arn=example_aws_s3_bucket["arn"],
 *     tags={
 *         "Environment": "Prod",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Aws.Route53.ResolverQueryLogConfig("example", new()
 *     {
 *         Name = "example",
 *         DestinationArn = exampleAwsS3Bucket.Arn,
 *         Tags =
 *         {
 *             { "Environment", "Prod" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"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 {
 * 		_, err := route53.NewResolverQueryLogConfig(ctx, "example", &route53.ResolverQueryLogConfigArgs{
 * 			Name:           pulumi.String("example"),
 * 			DestinationArn: pulumi.Any(exampleAwsS3Bucket.Arn),
 * 			Tags: pulumi.StringMap{
 * 				"Environment": pulumi.String("Prod"),
 * 			},
 * 		})
 * 		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.route53.ResolverQueryLogConfig;
 * import com.pulumi.aws.route53.ResolverQueryLogConfigArgs;
 * 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 ResolverQueryLogConfig("example", ResolverQueryLogConfigArgs.builder()
 *             .name("example")
 *             .destinationArn(exampleAwsS3Bucket.arn())
 *             .tags(Map.of("Environment", "Prod"))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: aws:route53:ResolverQueryLogConfig
 *     properties:
 *       name: example
 *       destinationArn: ${exampleAwsS3Bucket.arn}
 *       tags:
 *         Environment: Prod
 * ```
 * 
 * ## Import
 * Using `pulumi import`, import  Route 53 Resolver query logging configurations using the Route 53 Resolver query logging configuration ID. For example:
 * ```sh
 * $ pulumi import aws:route53/resolverQueryLogConfig:ResolverQueryLogConfig example rqlc-92edc3b1838248bf
 * ```
 */
public class ResolverQueryLogConfig internal constructor(
    override val javaResource: com.pulumi.aws.route53.ResolverQueryLogConfig,
) : KotlinCustomResource(javaResource, ResolverQueryLogConfigMapper) {
    /**
     * The ARN (Amazon Resource Name) of the Route 53 Resolver query logging configuration.
     */
    public val arn: Output
        get() = javaResource.arn().applyValue({ args0 -> args0 })

    /**
     * The ARN of the resource that you want Route 53 Resolver to send query logs.
     * You can send query logs to an S3 bucket, a CloudWatch Logs log group, or a Kinesis Data Firehose delivery stream.
     */
    public val destinationArn: Output
        get() = javaResource.destinationArn().applyValue({ args0 -> args0 })

    /**
     * The name of the Route 53 Resolver query logging configuration.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * The AWS account ID of the account that created the query logging configuration.
     */
    public val ownerId: Output
        get() = javaResource.ownerId().applyValue({ args0 -> args0 })

    /**
     * An indication of whether the query logging configuration is shared with other AWS accounts, or was shared with the current account by another AWS account.
     * Sharing is configured through AWS Resource Access Manager (AWS RAM).
     * Values are `NOT_SHARED`, `SHARED_BY_ME` or `SHARED_WITH_ME`
     */
    public val shareStatus: Output
        get() = javaResource.shareStatus().applyValue({ args0 -> args0 })

    /**
     * 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.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * A map of tags assigned to the resource, including those inherited from the provider `default_tags` configuration block.
     */
    @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 ResolverQueryLogConfigMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.aws.route53.ResolverQueryLogConfig::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy