Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.pulumi.aws.redshiftdata.kotlin.StatementArgs.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.aws.redshiftdata.kotlin
import com.pulumi.aws.redshiftdata.StatementArgs.builder
import com.pulumi.aws.redshiftdata.kotlin.inputs.StatementParameterArgs
import com.pulumi.aws.redshiftdata.kotlin.inputs.StatementParameterArgsBuilder
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.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName
/**
* Executes a Redshift Data Statement.
* ## Example Usage
* ### cluster_identifier
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* const example = new aws.redshiftdata.Statement("example", {
* clusterIdentifier: exampleAwsRedshiftCluster.clusterIdentifier,
* database: exampleAwsRedshiftCluster.databaseName,
* dbUser: exampleAwsRedshiftCluster.masterUsername,
* sql: "CREATE GROUP group_name;",
* });
* ```
* ```python
* import pulumi
* import pulumi_aws as aws
* example = aws.redshiftdata.Statement("example",
* cluster_identifier=example_aws_redshift_cluster["clusterIdentifier"],
* database=example_aws_redshift_cluster["databaseName"],
* db_user=example_aws_redshift_cluster["masterUsername"],
* sql="CREATE GROUP group_name;")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Aws = Pulumi.Aws;
* return await Deployment.RunAsync(() =>
* {
* var example = new Aws.RedshiftData.Statement("example", new()
* {
* ClusterIdentifier = exampleAwsRedshiftCluster.ClusterIdentifier,
* Database = exampleAwsRedshiftCluster.DatabaseName,
* DbUser = exampleAwsRedshiftCluster.MasterUsername,
* Sql = "CREATE GROUP group_name;",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/redshiftdata"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := redshiftdata.NewStatement(ctx, "example", &redshiftdata.StatementArgs{
* ClusterIdentifier: pulumi.Any(exampleAwsRedshiftCluster.ClusterIdentifier),
* Database: pulumi.Any(exampleAwsRedshiftCluster.DatabaseName),
* DbUser: pulumi.Any(exampleAwsRedshiftCluster.MasterUsername),
* Sql: pulumi.String("CREATE GROUP group_name;"),
* })
* 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.redshiftdata.Statement;
* import com.pulumi.aws.redshiftdata.StatementArgs;
* 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 Statement("example", StatementArgs.builder()
* .clusterIdentifier(exampleAwsRedshiftCluster.clusterIdentifier())
* .database(exampleAwsRedshiftCluster.databaseName())
* .dbUser(exampleAwsRedshiftCluster.masterUsername())
* .sql("CREATE GROUP group_name;")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: aws:redshiftdata:Statement
* properties:
* clusterIdentifier: ${exampleAwsRedshiftCluster.clusterIdentifier}
* database: ${exampleAwsRedshiftCluster.databaseName}
* dbUser: ${exampleAwsRedshiftCluster.masterUsername}
* sql: CREATE GROUP group_name;
* ```
*
* ### workgroup_name
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* const example = new aws.redshiftdata.Statement("example", {
* workgroupName: exampleAwsRedshiftserverlessWorkgroup.workgroupName,
* database: "dev",
* sql: "CREATE GROUP group_name;",
* });
* ```
* ```python
* import pulumi
* import pulumi_aws as aws
* example = aws.redshiftdata.Statement("example",
* workgroup_name=example_aws_redshiftserverless_workgroup["workgroupName"],
* database="dev",
* sql="CREATE GROUP group_name;")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Aws = Pulumi.Aws;
* return await Deployment.RunAsync(() =>
* {
* var example = new Aws.RedshiftData.Statement("example", new()
* {
* WorkgroupName = exampleAwsRedshiftserverlessWorkgroup.WorkgroupName,
* Database = "dev",
* Sql = "CREATE GROUP group_name;",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/redshiftdata"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := redshiftdata.NewStatement(ctx, "example", &redshiftdata.StatementArgs{
* WorkgroupName: pulumi.Any(exampleAwsRedshiftserverlessWorkgroup.WorkgroupName),
* Database: pulumi.String("dev"),
* Sql: pulumi.String("CREATE GROUP group_name;"),
* })
* 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.redshiftdata.Statement;
* import com.pulumi.aws.redshiftdata.StatementArgs;
* 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 Statement("example", StatementArgs.builder()
* .workgroupName(exampleAwsRedshiftserverlessWorkgroup.workgroupName())
* .database("dev")
* .sql("CREATE GROUP group_name;")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: aws:redshiftdata:Statement
* properties:
* workgroupName: ${exampleAwsRedshiftserverlessWorkgroup.workgroupName}
* database: dev
* sql: CREATE GROUP group_name;
* ```
*
* ## Import
* Using `pulumi import`, import Redshift Data Statements using the `id`. For example:
* ```sh
* $ pulumi import aws:redshiftdata/statement:Statement example example
* ```
* @property clusterIdentifier The cluster identifier. This parameter is required when connecting to a cluster and authenticating using either Secrets Manager or temporary credentials.
* @property database The name of the database.
* @property dbUser The database user name.
* @property parameters
* @property secretArn The name or ARN of the secret that enables access to the database.
* @property sql The SQL statement text to run.
* The following arguments are optional:
* @property statementName The name of the SQL statement. You can name the SQL statement when you create it to identify the query.
* @property withEvent A value that indicates whether to send an event to the Amazon EventBridge event bus after the SQL statement runs.
* @property workgroupName The serverless workgroup name. This parameter is required when connecting to a serverless workgroup and authenticating using either Secrets Manager or temporary credentials.
*/
public data class StatementArgs(
public val clusterIdentifier: Output? = null,
public val database: Output? = null,
public val dbUser: Output? = null,
public val parameters: Output>? = null,
public val secretArn: Output? = null,
public val sql: Output? = null,
public val statementName: Output? = null,
public val withEvent: Output? = null,
public val workgroupName: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.aws.redshiftdata.StatementArgs =
com.pulumi.aws.redshiftdata.StatementArgs.builder()
.clusterIdentifier(clusterIdentifier?.applyValue({ args0 -> args0 }))
.database(database?.applyValue({ args0 -> args0 }))
.dbUser(dbUser?.applyValue({ args0 -> args0 }))
.parameters(
parameters?.applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
})
}),
)
.secretArn(secretArn?.applyValue({ args0 -> args0 }))
.sql(sql?.applyValue({ args0 -> args0 }))
.statementName(statementName?.applyValue({ args0 -> args0 }))
.withEvent(withEvent?.applyValue({ args0 -> args0 }))
.workgroupName(workgroupName?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [StatementArgs].
*/
@PulumiTagMarker
public class StatementArgsBuilder internal constructor() {
private var clusterIdentifier: Output? = null
private var database: Output? = null
private var dbUser: Output? = null
private var parameters: Output>? = null
private var secretArn: Output? = null
private var sql: Output? = null
private var statementName: Output? = null
private var withEvent: Output? = null
private var workgroupName: Output? = null
/**
* @param value The cluster identifier. This parameter is required when connecting to a cluster and authenticating using either Secrets Manager or temporary credentials.
*/
@JvmName("avtqoxlkuoypsves")
public suspend fun clusterIdentifier(`value`: Output) {
this.clusterIdentifier = value
}
/**
* @param value The name of the database.
*/
@JvmName("mexepspyavisvdos")
public suspend fun database(`value`: Output) {
this.database = value
}
/**
* @param value The database user name.
*/
@JvmName("wiktrehbxfpgnpei")
public suspend fun dbUser(`value`: Output) {
this.dbUser = value
}
/**
* @param value
*/
@JvmName("ommeobnuvbabhprk")
public suspend fun parameters(`value`: Output>) {
this.parameters = value
}
@JvmName("jrhvpcrcwhvtypmd")
public suspend fun parameters(vararg values: Output) {
this.parameters = Output.all(values.asList())
}
/**
* @param values
*/
@JvmName("elivxmiixiomldip")
public suspend fun parameters(values: List>) {
this.parameters = Output.all(values)
}
/**
* @param value The name or ARN of the secret that enables access to the database.
*/
@JvmName("obghtensjaqlifyc")
public suspend fun secretArn(`value`: Output) {
this.secretArn = value
}
/**
* @param value The SQL statement text to run.
* The following arguments are optional:
*/
@JvmName("egbktvbhhgloobvc")
public suspend fun sql(`value`: Output) {
this.sql = value
}
/**
* @param value The name of the SQL statement. You can name the SQL statement when you create it to identify the query.
*/
@JvmName("nctovfqjwwasstei")
public suspend fun statementName(`value`: Output) {
this.statementName = value
}
/**
* @param value A value that indicates whether to send an event to the Amazon EventBridge event bus after the SQL statement runs.
*/
@JvmName("tgfusqolixaatcgt")
public suspend fun withEvent(`value`: Output) {
this.withEvent = value
}
/**
* @param value The serverless workgroup name. This parameter is required when connecting to a serverless workgroup and authenticating using either Secrets Manager or temporary credentials.
*/
@JvmName("orqifmqaidqwimrx")
public suspend fun workgroupName(`value`: Output) {
this.workgroupName = value
}
/**
* @param value The cluster identifier. This parameter is required when connecting to a cluster and authenticating using either Secrets Manager or temporary credentials.
*/
@JvmName("mddogdyasoarkcys")
public suspend fun clusterIdentifier(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.clusterIdentifier = mapped
}
/**
* @param value The name of the database.
*/
@JvmName("kskuivocfngplvky")
public suspend fun database(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.database = mapped
}
/**
* @param value The database user name.
*/
@JvmName("qffmogexqgidpiyk")
public suspend fun dbUser(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.dbUser = mapped
}
/**
* @param value
*/
@JvmName("wrfuhlewwycpgpmb")
public suspend fun parameters(`value`: List?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.parameters = mapped
}
/**
* @param argument
*/
@JvmName("ylbnuyqiypjxalfy")
public suspend fun parameters(argument: List Unit>) {
val toBeMapped = argument.toList().map {
StatementParameterArgsBuilder().applySuspend {
it()
}.build()
}
val mapped = of(toBeMapped)
this.parameters = mapped
}
/**
* @param argument
*/
@JvmName("qtaobhwpqfkuipsa")
public suspend fun parameters(vararg argument: suspend StatementParameterArgsBuilder.() -> Unit) {
val toBeMapped = argument.toList().map {
StatementParameterArgsBuilder().applySuspend {
it()
}.build()
}
val mapped = of(toBeMapped)
this.parameters = mapped
}
/**
* @param argument
*/
@JvmName("jlneimlbwyejfqod")
public suspend fun parameters(argument: suspend StatementParameterArgsBuilder.() -> Unit) {
val toBeMapped = listOf(StatementParameterArgsBuilder().applySuspend { argument() }.build())
val mapped = of(toBeMapped)
this.parameters = mapped
}
/**
* @param values
*/
@JvmName("kldihclvvtornoqd")
public suspend fun parameters(vararg values: StatementParameterArgs) {
val toBeMapped = values.toList()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.parameters = mapped
}
/**
* @param value The name or ARN of the secret that enables access to the database.
*/
@JvmName("dxcbqkhuygmmnkwg")
public suspend fun secretArn(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.secretArn = mapped
}
/**
* @param value The SQL statement text to run.
* The following arguments are optional:
*/
@JvmName("hcoycykpeafecqrc")
public suspend fun sql(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.sql = mapped
}
/**
* @param value The name of the SQL statement. You can name the SQL statement when you create it to identify the query.
*/
@JvmName("vejkxysqfpqhggva")
public suspend fun statementName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.statementName = mapped
}
/**
* @param value A value that indicates whether to send an event to the Amazon EventBridge event bus after the SQL statement runs.
*/
@JvmName("sfebshcwthumdutg")
public suspend fun withEvent(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.withEvent = mapped
}
/**
* @param value The serverless workgroup name. This parameter is required when connecting to a serverless workgroup and authenticating using either Secrets Manager or temporary credentials.
*/
@JvmName("nxbhepgbjjnsbktx")
public suspend fun workgroupName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.workgroupName = mapped
}
internal fun build(): StatementArgs = StatementArgs(
clusterIdentifier = clusterIdentifier,
database = database,
dbUser = dbUser,
parameters = parameters,
secretArn = secretArn,
sql = sql,
statementName = statementName,
withEvent = withEvent,
workgroupName = workgroupName,
)
}