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

com.pulumi.aws.cleanrooms.kotlin.ConfiguredTable.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.cleanrooms.kotlin

import com.pulumi.aws.cleanrooms.kotlin.outputs.ConfiguredTableTableReference
import com.pulumi.aws.cleanrooms.kotlin.outputs.ConfiguredTableTableReference.Companion.toKotlin
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.List
import kotlin.collections.Map

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

    public var args: ConfiguredTableArgs = ConfiguredTableArgs()

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

/**
 * Provides a AWS Clean Rooms configured table. Configured tables are used to represent references to existing tables in the AWS Glue Data Catalog.
 * ## Example Usage
 * ### Configured table with tags
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const testConfiguredTable = new aws.cleanrooms.ConfiguredTable("test_configured_table", {
 *     name: "pulumi-example-table",
 *     description: "I made this table with Pulumi!",
 *     analysisMethod: "DIRECT_QUERY",
 *     allowedColumns: [
 *         "column1",
 *         "column2",
 *         "column3",
 *     ],
 *     tableReference: {
 *         databaseName: "example_database",
 *         tableName: "example_table",
 *     },
 *     tags: {
 *         Project: "Pulumi",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * test_configured_table = aws.cleanrooms.ConfiguredTable("test_configured_table",
 *     name="pulumi-example-table",
 *     description="I made this table with Pulumi!",
 *     analysis_method="DIRECT_QUERY",
 *     allowed_columns=[
 *         "column1",
 *         "column2",
 *         "column3",
 *     ],
 *     table_reference={
 *         "database_name": "example_database",
 *         "table_name": "example_table",
 *     },
 *     tags={
 *         "Project": "Pulumi",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var testConfiguredTable = new Aws.CleanRooms.ConfiguredTable("test_configured_table", new()
 *     {
 *         Name = "pulumi-example-table",
 *         Description = "I made this table with Pulumi!",
 *         AnalysisMethod = "DIRECT_QUERY",
 *         AllowedColumns = new[]
 *         {
 *             "column1",
 *             "column2",
 *             "column3",
 *         },
 *         TableReference = new Aws.CleanRooms.Inputs.ConfiguredTableTableReferenceArgs
 *         {
 *             DatabaseName = "example_database",
 *             TableName = "example_table",
 *         },
 *         Tags =
 *         {
 *             { "Project", "Pulumi" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cleanrooms"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := cleanrooms.NewConfiguredTable(ctx, "test_configured_table", &cleanrooms.ConfiguredTableArgs{
 * 			Name:           pulumi.String("pulumi-example-table"),
 * 			Description:    pulumi.String("I made this table with Pulumi!"),
 * 			AnalysisMethod: pulumi.String("DIRECT_QUERY"),
 * 			AllowedColumns: pulumi.StringArray{
 * 				pulumi.String("column1"),
 * 				pulumi.String("column2"),
 * 				pulumi.String("column3"),
 * 			},
 * 			TableReference: &cleanrooms.ConfiguredTableTableReferenceArgs{
 * 				DatabaseName: pulumi.String("example_database"),
 * 				TableName:    pulumi.String("example_table"),
 * 			},
 * 			Tags: pulumi.StringMap{
 * 				"Project": pulumi.String("Pulumi"),
 * 			},
 * 		})
 * 		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.cleanrooms.ConfiguredTable;
 * import com.pulumi.aws.cleanrooms.ConfiguredTableArgs;
 * import com.pulumi.aws.cleanrooms.inputs.ConfiguredTableTableReferenceArgs;
 * 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 testConfiguredTable = new ConfiguredTable("testConfiguredTable", ConfiguredTableArgs.builder()
 *             .name("pulumi-example-table")
 *             .description("I made this table with Pulumi!")
 *             .analysisMethod("DIRECT_QUERY")
 *             .allowedColumns(
 *                 "column1",
 *                 "column2",
 *                 "column3")
 *             .tableReference(ConfiguredTableTableReferenceArgs.builder()
 *                 .databaseName("example_database")
 *                 .tableName("example_table")
 *                 .build())
 *             .tags(Map.of("Project", "Pulumi"))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   testConfiguredTable:
 *     type: aws:cleanrooms:ConfiguredTable
 *     name: test_configured_table
 *     properties:
 *       name: pulumi-example-table
 *       description: I made this table with Pulumi!
 *       analysisMethod: DIRECT_QUERY
 *       allowedColumns:
 *         - column1
 *         - column2
 *         - column3
 *       tableReference:
 *         databaseName: example_database
 *         tableName: example_table
 *       tags:
 *         Project: Pulumi
 * ```
 * 
 * ## Import
 * Using `pulumi import`, import `aws_cleanrooms_configured_table` using the `id`. For example:
 * ```sh
 * $ pulumi import aws:cleanrooms/configuredTable:ConfiguredTable table 1234abcd-12ab-34cd-56ef-1234567890ab
 * ```
 */
public class ConfiguredTable internal constructor(
    override val javaResource: com.pulumi.aws.cleanrooms.ConfiguredTable,
) : KotlinCustomResource(javaResource, ConfiguredTableMapper) {
    /**
     * The columns of the references table which will be included in the configured table.
     */
    public val allowedColumns: Output>
        get() = javaResource.allowedColumns().applyValue({ args0 -> args0.map({ args0 -> args0 }) })

    /**
     * The analysis method for the configured table. The only valid value is currently `DIRECT_QUERY`.
     */
    public val analysisMethod: Output
        get() = javaResource.analysisMethod().applyValue({ args0 -> args0 })

    /**
     * The ARN of the configured table.
     */
    public val arn: Output
        get() = javaResource.arn().applyValue({ args0 -> args0 })

    /**
     * The date and time the configured table was created.
     */
    public val createTime: Output
        get() = javaResource.createTime().applyValue({ args0 -> args0 })

    /**
     * A description for the configured table.
     */
    public val description: Output?
        get() = javaResource.description().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The name of the configured table.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * A reference to the AWS Glue table which will be used to create the configured table.
     * * `table_reference.database_name` - (Required - Forces new resource) - The name of the AWS Glue database which contains the table.
     * * `table_reference.table_name` - (Required - Forces new resource) - The name of the AWS Glue table which will be used to create the configured table.
     */
    public val tableReference: Output
        get() = javaResource.tableReference().applyValue({ args0 ->
            args0.let({ args0 ->
                toKotlin(args0)
            })
        })

    /**
     * Key value pairs which tag the configured table.
     */
    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()
        })

    /**
     * The date and time the configured table was last updated.
     */
    public val updateTime: Output
        get() = javaResource.updateTime().applyValue({ args0 -> args0 })
}

public object ConfiguredTableMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.aws.cleanrooms.ConfiguredTable::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy