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

com.pulumi.aws.athena.kotlin.DatabaseArgs.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.DatabaseArgs.builder
import com.pulumi.aws.athena.kotlin.inputs.DatabaseAclConfigurationArgs
import com.pulumi.aws.athena.kotlin.inputs.DatabaseAclConfigurationArgsBuilder
import com.pulumi.aws.athena.kotlin.inputs.DatabaseEncryptionConfigurationArgs
import com.pulumi.aws.athena.kotlin.inputs.DatabaseEncryptionConfigurationArgsBuilder
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 database.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const example = new aws.s3.BucketV2("example", {bucket: "example"});
 * const exampleDatabase = new aws.athena.Database("example", {
 *     name: "database_name",
 *     bucket: example.id,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * example = aws.s3.BucketV2("example", bucket="example")
 * example_database = aws.athena.Database("example",
 *     name="database_name",
 *     bucket=example.id)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Aws.S3.BucketV2("example", new()
 *     {
 *         Bucket = "example",
 *     });
 *     var exampleDatabase = new Aws.Athena.Database("example", new()
 *     {
 *         Name = "database_name",
 *         Bucket = example.Id,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/athena"
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := s3.NewBucketV2(ctx, "example", &s3.BucketV2Args{
 * 			Bucket: pulumi.String("example"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = athena.NewDatabase(ctx, "example", &athena.DatabaseArgs{
 * 			Name:   pulumi.String("database_name"),
 * 			Bucket: example.ID(),
 * 		})
 * 		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.s3.BucketV2;
 * import com.pulumi.aws.s3.BucketV2Args;
 * import com.pulumi.aws.athena.Database;
 * import com.pulumi.aws.athena.DatabaseArgs;
 * 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 BucketV2("example", BucketV2Args.builder()
 *             .bucket("example")
 *             .build());
 *         var exampleDatabase = new Database("exampleDatabase", DatabaseArgs.builder()
 *             .name("database_name")
 *             .bucket(example.id())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: aws:s3:BucketV2
 *     properties:
 *       bucket: example
 *   exampleDatabase:
 *     type: aws:athena:Database
 *     name: example
 *     properties:
 *       name: database_name
 *       bucket: ${example.id}
 * ```
 * 
 * ## Import
 * Using `pulumi import`, import Athena Databases using their name. For example:
 * ```sh
 * $ pulumi import aws:athena/database:Database example example
 * ```
 * Certain resource arguments, like `encryption_configuration` and `bucket`, do not have an API method for reading the information after creation. If the argument is set in the Pulumi program on an imported resource, Pulumi will always show a difference. To workaround this behavior, either omit the argument from the Pulumi program or use `ignore_changes` to hide the difference. For example:
 * @property aclConfiguration That an Amazon S3 canned ACL should be set to control ownership of stored query results. See ACL Configuration below.
 * @property bucket Name of S3 bucket to save the results of the query execution.
 * @property comment Description of the database.
 * @property encryptionConfiguration Encryption key block AWS Athena uses to decrypt the data in S3, such as an AWS Key Management Service (AWS KMS) key. See Encryption Configuration below.
 * @property expectedBucketOwner AWS account ID that you expect to be the owner of the Amazon S3 bucket.
 * @property forceDestroy Boolean that indicates all tables should be deleted from the database so that the database can be destroyed without error. The tables are *not* recoverable.
 * @property name Name of the database to create.
 * @property properties Key-value map of custom metadata properties for the database definition.
 */
public data class DatabaseArgs(
    public val aclConfiguration: Output? = null,
    public val bucket: Output? = null,
    public val comment: Output? = null,
    public val encryptionConfiguration: Output? = null,
    public val expectedBucketOwner: Output? = null,
    public val forceDestroy: Output? = null,
    public val name: Output? = null,
    public val properties: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.aws.athena.DatabaseArgs =
        com.pulumi.aws.athena.DatabaseArgs.builder()
            .aclConfiguration(aclConfiguration?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .bucket(bucket?.applyValue({ args0 -> args0 }))
            .comment(comment?.applyValue({ args0 -> args0 }))
            .encryptionConfiguration(
                encryptionConfiguration?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .expectedBucketOwner(expectedBucketOwner?.applyValue({ args0 -> args0 }))
            .forceDestroy(forceDestroy?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .properties(
                properties?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            ).build()
}

/**
 * Builder for [DatabaseArgs].
 */
@PulumiTagMarker
public class DatabaseArgsBuilder internal constructor() {
    private var aclConfiguration: Output? = null

    private var bucket: Output? = null

    private var comment: Output? = null

    private var encryptionConfiguration: Output? = null

    private var expectedBucketOwner: Output? = null

    private var forceDestroy: Output? = null

    private var name: Output? = null

    private var properties: Output>? = null

    /**
     * @param value That an Amazon S3 canned ACL should be set to control ownership of stored query results. See ACL Configuration below.
     */
    @JvmName("lqgneebkkrvfxoow")
    public suspend fun aclConfiguration(`value`: Output) {
        this.aclConfiguration = value
    }

    /**
     * @param value Name of S3 bucket to save the results of the query execution.
     */
    @JvmName("iycqgkkuoopjhgaa")
    public suspend fun bucket(`value`: Output) {
        this.bucket = value
    }

    /**
     * @param value Description of the database.
     */
    @JvmName("yuwubtxosukhemma")
    public suspend fun comment(`value`: Output) {
        this.comment = value
    }

    /**
     * @param value Encryption key block AWS Athena uses to decrypt the data in S3, such as an AWS Key Management Service (AWS KMS) key. See Encryption Configuration below.
     */
    @JvmName("bdkhyhxrqihcweqr")
    public suspend fun encryptionConfiguration(`value`: Output) {
        this.encryptionConfiguration = value
    }

    /**
     * @param value AWS account ID that you expect to be the owner of the Amazon S3 bucket.
     */
    @JvmName("maeettttufgiwmax")
    public suspend fun expectedBucketOwner(`value`: Output) {
        this.expectedBucketOwner = value
    }

    /**
     * @param value Boolean that indicates all tables should be deleted from the database so that the database can be destroyed without error. The tables are *not* recoverable.
     */
    @JvmName("cdldogethgejfrvw")
    public suspend fun forceDestroy(`value`: Output) {
        this.forceDestroy = value
    }

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

    /**
     * @param value Key-value map of custom metadata properties for the database definition.
     */
    @JvmName("mhjvhjbspqtvsehp")
    public suspend fun properties(`value`: Output>) {
        this.properties = value
    }

    /**
     * @param value That an Amazon S3 canned ACL should be set to control ownership of stored query results. See ACL Configuration below.
     */
    @JvmName("tdxwyodplmxhqvxb")
    public suspend fun aclConfiguration(`value`: DatabaseAclConfigurationArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.aclConfiguration = mapped
    }

    /**
     * @param argument That an Amazon S3 canned ACL should be set to control ownership of stored query results. See ACL Configuration below.
     */
    @JvmName("qkskrjodwukyqfsp")
    public suspend fun aclConfiguration(argument: suspend DatabaseAclConfigurationArgsBuilder.() -> Unit) {
        val toBeMapped = DatabaseAclConfigurationArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.aclConfiguration = mapped
    }

    /**
     * @param value Name of S3 bucket to save the results of the query execution.
     */
    @JvmName("ydsxxjhmdabstbin")
    public suspend fun bucket(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.bucket = mapped
    }

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

    /**
     * @param value Encryption key block AWS Athena uses to decrypt the data in S3, such as an AWS Key Management Service (AWS KMS) key. See Encryption Configuration below.
     */
    @JvmName("baowxsabiqdaoase")
    public suspend fun encryptionConfiguration(`value`: DatabaseEncryptionConfigurationArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.encryptionConfiguration = mapped
    }

    /**
     * @param argument Encryption key block AWS Athena uses to decrypt the data in S3, such as an AWS Key Management Service (AWS KMS) key. See Encryption Configuration below.
     */
    @JvmName("vdidfdakorocxriw")
    public suspend fun encryptionConfiguration(argument: suspend DatabaseEncryptionConfigurationArgsBuilder.() -> Unit) {
        val toBeMapped = DatabaseEncryptionConfigurationArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.encryptionConfiguration = mapped
    }

    /**
     * @param value AWS account ID that you expect to be the owner of the Amazon S3 bucket.
     */
    @JvmName("chbyhvwnivtkwnbq")
    public suspend fun expectedBucketOwner(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.expectedBucketOwner = mapped
    }

    /**
     * @param value Boolean that indicates all tables should be deleted from the database so that the database can be destroyed without error. The tables are *not* recoverable.
     */
    @JvmName("oihmnlmrbiihaxpc")
    public suspend fun forceDestroy(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.forceDestroy = mapped
    }

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

    /**
     * @param value Key-value map of custom metadata properties for the database definition.
     */
    @JvmName("lqfhkrdcvqbfyehu")
    public suspend fun properties(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.properties = mapped
    }

    /**
     * @param values Key-value map of custom metadata properties for the database definition.
     */
    @JvmName("ojlfcwrxpbdfsvpk")
    public fun properties(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.properties = mapped
    }

    internal fun build(): DatabaseArgs = DatabaseArgs(
        aclConfiguration = aclConfiguration,
        bucket = bucket,
        comment = comment,
        encryptionConfiguration = encryptionConfiguration,
        expectedBucketOwner = expectedBucketOwner,
        forceDestroy = forceDestroy,
        name = name,
        properties = properties,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy