StatementArgs

data class StatementArgs(val clusterIdentifier: Output<String>? = null, val database: Output<String>? = null, val dbUser: Output<String>? = null, val parameters: Output<List<StatementParameterArgs>>? = null, val secretArn: Output<String>? = null, val sql: Output<String>? = null, val statementName: Output<String>? = null, val withEvent: Output<Boolean>? = null, val workgroupName: Output<String>? = null) : ConvertibleToJava<StatementArgs>

Executes a Redshift Data Statement.

Example Usage

cluster_identifier

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;",
});
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;")
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;",
});
});
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
})
}
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());
}
}
resources:
example:
type: aws:redshiftdata:Statement
properties:
clusterIdentifier: ${exampleAwsRedshiftCluster.clusterIdentifier}
database: ${exampleAwsRedshiftCluster.databaseName}
dbUser: ${exampleAwsRedshiftCluster.masterUsername}
sql: CREATE GROUP group_name;

workgroup_name

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;",
});
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;")
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;",
});
});
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
})
}
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());
}
}
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:

$ pulumi import aws:redshiftdata/statement:Statement example example

Constructors

Link copied to clipboard
constructor(clusterIdentifier: Output<String>? = null, database: Output<String>? = null, dbUser: Output<String>? = null, parameters: Output<List<StatementParameterArgs>>? = null, secretArn: Output<String>? = null, sql: Output<String>? = null, statementName: Output<String>? = null, withEvent: Output<Boolean>? = null, workgroupName: Output<String>? = null)

Properties

Link copied to clipboard
val clusterIdentifier: Output<String>? = null

The cluster identifier. This parameter is required when connecting to a cluster and authenticating using either Secrets Manager or temporary credentials.

Link copied to clipboard
val database: Output<String>? = null

The name of the database.

Link copied to clipboard
val dbUser: Output<String>? = null

The database user name.

Link copied to clipboard
val parameters: Output<List<StatementParameterArgs>>? = null
Link copied to clipboard
val secretArn: Output<String>? = null

The name or ARN of the secret that enables access to the database.

Link copied to clipboard
val sql: Output<String>? = null

The SQL statement text to run. The following arguments are optional:

Link copied to clipboard
val statementName: Output<String>? = null

The name of the SQL statement. You can name the SQL statement when you create it to identify the query.

Link copied to clipboard
val withEvent: Output<Boolean>? = null

A value that indicates whether to send an event to the Amazon EventBridge event bus after the SQL statement runs.

Link copied to clipboard
val workgroupName: Output<String>? = null

The serverless workgroup name. This parameter is required when connecting to a serverless workgroup and authenticating using either Secrets Manager or temporary credentials.

Functions

Link copied to clipboard
open override fun toJava(): StatementArgs