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

com.pulumi.aws.athena.kotlin.WorkgroupArgs.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.athena.kotlin

import com.pulumi.aws.athena.WorkgroupArgs.builder
import com.pulumi.aws.athena.kotlin.inputs.WorkgroupConfigurationArgs
import com.pulumi.aws.athena.kotlin.inputs.WorkgroupConfigurationArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Provides an Athena Workgroup.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const example = new aws.athena.Workgroup("example", {
 *     name: "example",
 *     configuration: {
 *         enforceWorkgroupConfiguration: true,
 *         publishCloudwatchMetricsEnabled: true,
 *         resultConfiguration: {
 *             outputLocation: `s3://${exampleAwsS3Bucket.bucket}/output/`,
 *             encryptionConfiguration: {
 *                 encryptionOption: "SSE_KMS",
 *                 kmsKeyArn: exampleAwsKmsKey.arn,
 *             },
 *         },
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * example = aws.athena.Workgroup("example",
 *     name="example",
 *     configuration={
 *         "enforce_workgroup_configuration": True,
 *         "publish_cloudwatch_metrics_enabled": True,
 *         "result_configuration": {
 *             "output_location": f"s3://{example_aws_s3_bucket['bucket']}/output/",
 *             "encryption_configuration": {
 *                 "encryption_option": "SSE_KMS",
 *                 "kms_key_arn": example_aws_kms_key["arn"],
 *             },
 *         },
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Aws.Athena.Workgroup("example", new()
 *     {
 *         Name = "example",
 *         Configuration = new Aws.Athena.Inputs.WorkgroupConfigurationArgs
 *         {
 *             EnforceWorkgroupConfiguration = true,
 *             PublishCloudwatchMetricsEnabled = true,
 *             ResultConfiguration = new Aws.Athena.Inputs.WorkgroupConfigurationResultConfigurationArgs
 *             {
 *                 OutputLocation = $"s3://{exampleAwsS3Bucket.Bucket}/output/",
 *                 EncryptionConfiguration = new Aws.Athena.Inputs.WorkgroupConfigurationResultConfigurationEncryptionConfigurationArgs
 *                 {
 *                     EncryptionOption = "SSE_KMS",
 *                     KmsKeyArn = exampleAwsKmsKey.Arn,
 *                 },
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"fmt"
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/athena"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := athena.NewWorkgroup(ctx, "example", &athena.WorkgroupArgs{
 * 			Name: pulumi.String("example"),
 * 			Configuration: &athena.WorkgroupConfigurationArgs{
 * 				EnforceWorkgroupConfiguration:   pulumi.Bool(true),
 * 				PublishCloudwatchMetricsEnabled: pulumi.Bool(true),
 * 				ResultConfiguration: &athena.WorkgroupConfigurationResultConfigurationArgs{
 * 					OutputLocation: pulumi.Sprintf("s3://%v/output/", exampleAwsS3Bucket.Bucket),
 * 					EncryptionConfiguration: &athena.WorkgroupConfigurationResultConfigurationEncryptionConfigurationArgs{
 * 						EncryptionOption: pulumi.String("SSE_KMS"),
 * 						KmsKeyArn:        pulumi.Any(exampleAwsKmsKey.Arn),
 * 					},
 * 				},
 * 			},
 * 		})
 * 		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.athena.Workgroup;
 * import com.pulumi.aws.athena.WorkgroupArgs;
 * import com.pulumi.aws.athena.inputs.WorkgroupConfigurationArgs;
 * import com.pulumi.aws.athena.inputs.WorkgroupConfigurationResultConfigurationArgs;
 * import com.pulumi.aws.athena.inputs.WorkgroupConfigurationResultConfigurationEncryptionConfigurationArgs;
 * 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 Workgroup("example", WorkgroupArgs.builder()
 *             .name("example")
 *             .configuration(WorkgroupConfigurationArgs.builder()
 *                 .enforceWorkgroupConfiguration(true)
 *                 .publishCloudwatchMetricsEnabled(true)
 *                 .resultConfiguration(WorkgroupConfigurationResultConfigurationArgs.builder()
 *                     .outputLocation(String.format("s3://%s/output/", exampleAwsS3Bucket.bucket()))
 *                     .encryptionConfiguration(WorkgroupConfigurationResultConfigurationEncryptionConfigurationArgs.builder()
 *                         .encryptionOption("SSE_KMS")
 *                         .kmsKeyArn(exampleAwsKmsKey.arn())
 *                         .build())
 *                     .build())
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: aws:athena:Workgroup
 *     properties:
 *       name: example
 *       configuration:
 *         enforceWorkgroupConfiguration: true
 *         publishCloudwatchMetricsEnabled: true
 *         resultConfiguration:
 *           outputLocation: s3://${exampleAwsS3Bucket.bucket}/output/
 *           encryptionConfiguration:
 *             encryptionOption: SSE_KMS
 *             kmsKeyArn: ${exampleAwsKmsKey.arn}
 * ```
 * 
 * ## Import
 * Using `pulumi import`, import Athena Workgroups using their name. For example:
 * ```sh
 * $ pulumi import aws:athena/workgroup:Workgroup example example
 * ```
 * @property configuration Configuration block with various settings for the workgroup. Documented below.
 * @property description Description of the workgroup.
 * @property forceDestroy Option to delete the workgroup and its contents even if the workgroup contains any named queries.
 * @property name Name of the workgroup.
 * @property state State of the workgroup. Valid values are `DISABLED` or `ENABLED`. Defaults to `ENABLED`.
 * @property tags Key-value map of resource tags for the workgroup. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
 */
public data class WorkgroupArgs(
    public val configuration: Output? = null,
    public val description: Output? = null,
    public val forceDestroy: Output? = null,
    public val name: Output? = null,
    public val state: Output? = null,
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.aws.athena.WorkgroupArgs =
        com.pulumi.aws.athena.WorkgroupArgs.builder()
            .configuration(configuration?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .description(description?.applyValue({ args0 -> args0 }))
            .forceDestroy(forceDestroy?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .state(state?.applyValue({ args0 -> args0 }))
            .tags(
                tags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            ).build()
}

/**
 * Builder for [WorkgroupArgs].
 */
@PulumiTagMarker
public class WorkgroupArgsBuilder internal constructor() {
    private var configuration: Output? = null

    private var description: Output? = null

    private var forceDestroy: Output? = null

    private var name: Output? = null

    private var state: Output? = null

    private var tags: Output>? = null

    /**
     * @param value Configuration block with various settings for the workgroup. Documented below.
     */
    @JvmName("fwoxrkimeuenkbdw")
    public suspend fun configuration(`value`: Output) {
        this.configuration = value
    }

    /**
     * @param value Description of the workgroup.
     */
    @JvmName("kyocsdpwlkngjnbi")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value Option to delete the workgroup and its contents even if the workgroup contains any named queries.
     */
    @JvmName("njgdvrqksoenkhpf")
    public suspend fun forceDestroy(`value`: Output) {
        this.forceDestroy = value
    }

    /**
     * @param value Name of the workgroup.
     */
    @JvmName("qyrpmblksltgyjwn")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value State of the workgroup. Valid values are `DISABLED` or `ENABLED`. Defaults to `ENABLED`.
     */
    @JvmName("atuchmwevnsgckip")
    public suspend fun state(`value`: Output) {
        this.state = value
    }

    /**
     * @param value Key-value map of resource tags for the workgroup. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
     */
    @JvmName("xpgchghllyvfrehv")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value Configuration block with various settings for the workgroup. Documented below.
     */
    @JvmName("gsmnmcwjqdwsxemu")
    public suspend fun configuration(`value`: WorkgroupConfigurationArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.configuration = mapped
    }

    /**
     * @param argument Configuration block with various settings for the workgroup. Documented below.
     */
    @JvmName("dccyypbdjvldtafl")
    public suspend fun configuration(argument: suspend WorkgroupConfigurationArgsBuilder.() -> Unit) {
        val toBeMapped = WorkgroupConfigurationArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.configuration = mapped
    }

    /**
     * @param value Description of the workgroup.
     */
    @JvmName("spdhdcmrabbjlynn")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value Option to delete the workgroup and its contents even if the workgroup contains any named queries.
     */
    @JvmName("mdthpniuiofhwfbh")
    public suspend fun forceDestroy(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.forceDestroy = mapped
    }

    /**
     * @param value Name of the workgroup.
     */
    @JvmName("qwbqiuknerxwyevw")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value State of the workgroup. Valid values are `DISABLED` or `ENABLED`. Defaults to `ENABLED`.
     */
    @JvmName("inwmylqewdmjmamu")
    public suspend fun state(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.state = mapped
    }

    /**
     * @param value Key-value map of resource tags for the workgroup. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
     */
    @JvmName("nxmdiprsyifwtutc")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values Key-value map of resource tags for the workgroup. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
     */
    @JvmName("jlaljbieyqnwttjj")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    internal fun build(): WorkgroupArgs = WorkgroupArgs(
        configuration = configuration,
        description = description,
        forceDestroy = forceDestroy,
        name = name,
        state = state,
        tags = tags,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy