com.pulumi.aws.glue.kotlin.CatalogTableOptimizer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-aws-kotlin Show documentation
Show all versions of pulumi-aws-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.aws.glue.kotlin
import com.pulumi.aws.glue.kotlin.outputs.CatalogTableOptimizerConfiguration
import com.pulumi.aws.glue.kotlin.outputs.CatalogTableOptimizerConfiguration.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.String
import kotlin.Suppress
import kotlin.Unit
/**
* Builder for [CatalogTableOptimizer].
*/
@PulumiTagMarker
public class CatalogTableOptimizerResourceBuilder internal constructor() {
public var name: String? = null
public var args: CatalogTableOptimizerArgs = CatalogTableOptimizerArgs()
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 CatalogTableOptimizerArgsBuilder.() -> Unit) {
val builder = CatalogTableOptimizerArgsBuilder()
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(): CatalogTableOptimizer {
val builtJavaResource = com.pulumi.aws.glue.CatalogTableOptimizer(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return CatalogTableOptimizer(builtJavaResource)
}
}
/**
* Resource for managing an AWS Glue Catalog Table Optimizer.
* ## Example Usage
* ### Basic Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* const example = new aws.glue.CatalogTableOptimizer("example", {
* catalogId: "123456789012",
* databaseName: "example_database",
* tableName: "example_table",
* configuration: {
* roleArn: "arn:aws:iam::123456789012:role/example-role",
* enabled: true,
* },
* type: "compaction",
* });
* ```
* ```python
* import pulumi
* import pulumi_aws as aws
* example = aws.glue.CatalogTableOptimizer("example",
* catalog_id="123456789012",
* database_name="example_database",
* table_name="example_table",
* configuration={
* "role_arn": "arn:aws:iam::123456789012:role/example-role",
* "enabled": True,
* },
* type="compaction")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Aws = Pulumi.Aws;
* return await Deployment.RunAsync(() =>
* {
* var example = new Aws.Glue.CatalogTableOptimizer("example", new()
* {
* CatalogId = "123456789012",
* DatabaseName = "example_database",
* TableName = "example_table",
* Configuration = new Aws.Glue.Inputs.CatalogTableOptimizerConfigurationArgs
* {
* RoleArn = "arn:aws:iam::123456789012:role/example-role",
* Enabled = true,
* },
* Type = "compaction",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/glue"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := glue.NewCatalogTableOptimizer(ctx, "example", &glue.CatalogTableOptimizerArgs{
* CatalogId: pulumi.String("123456789012"),
* DatabaseName: pulumi.String("example_database"),
* TableName: pulumi.String("example_table"),
* Configuration: &glue.CatalogTableOptimizerConfigurationArgs{
* RoleArn: pulumi.String("arn:aws:iam::123456789012:role/example-role"),
* Enabled: pulumi.Bool(true),
* },
* Type: pulumi.String("compaction"),
* })
* 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.glue.CatalogTableOptimizer;
* import com.pulumi.aws.glue.CatalogTableOptimizerArgs;
* import com.pulumi.aws.glue.inputs.CatalogTableOptimizerConfigurationArgs;
* 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 CatalogTableOptimizer("example", CatalogTableOptimizerArgs.builder()
* .catalogId("123456789012")
* .databaseName("example_database")
* .tableName("example_table")
* .configuration(CatalogTableOptimizerConfigurationArgs.builder()
* .roleArn("arn:aws:iam::123456789012:role/example-role")
* .enabled(true)
* .build())
* .type("compaction")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: aws:glue:CatalogTableOptimizer
* properties:
* catalogId: '123456789012'
* databaseName: example_database
* tableName: example_table
* configuration:
* roleArn: arn:aws:iam::123456789012:role/example-role
* enabled: true
* type: compaction
* ```
*
* ## Import
* Using `pulumi import`, import Glue Catalog Table Optimizer using the `catalog_id,database_name,table_name,type`. For example:
* ```sh
* $ pulumi import aws:glue/catalogTableOptimizer:CatalogTableOptimizer example 123456789012,example_database,example_table,compaction
* ```
*/
public class CatalogTableOptimizer internal constructor(
override val javaResource: com.pulumi.aws.glue.CatalogTableOptimizer,
) : KotlinCustomResource(javaResource, CatalogTableOptimizerMapper) {
/**
* The Catalog ID of the table.
*/
public val catalogId: Output
get() = javaResource.catalogId().applyValue({ args0 -> args0 })
/**
* A configuration block that defines the table optimizer settings. The block contains:
*/
public val configuration: Output?
get() = javaResource.configuration().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> toKotlin(args0) })
}).orElse(null)
})
/**
* The name of the database in the catalog in which the table resides.
*/
public val databaseName: Output
get() = javaResource.databaseName().applyValue({ args0 -> args0 })
/**
* The name of the table.
*/
public val tableName: Output
get() = javaResource.tableName().applyValue({ args0 -> args0 })
/**
* The type of table optimizer. Currently, the only valid value is compaction.
*/
public val type: Output
get() = javaResource.type().applyValue({ args0 -> args0 })
}
public object CatalogTableOptimizerMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.aws.glue.CatalogTableOptimizer::class == javaResource::class
override fun map(javaResource: Resource): CatalogTableOptimizer =
CatalogTableOptimizer(javaResource as com.pulumi.aws.glue.CatalogTableOptimizer)
}
/**
* @see [CatalogTableOptimizer].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [CatalogTableOptimizer].
*/
public suspend fun catalogTableOptimizer(
name: String,
block: suspend CatalogTableOptimizerResourceBuilder.() -> Unit,
): CatalogTableOptimizer {
val builder = CatalogTableOptimizerResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [CatalogTableOptimizer].
* @param name The _unique_ name of the resulting resource.
*/
public fun catalogTableOptimizer(name: String): CatalogTableOptimizer {
val builder = CatalogTableOptimizerResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy