Statement Args
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;",
});
Content copied to clipboard
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;")
Content copied to clipboard
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;",
});
});
Content copied to clipboard
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
})
}
Content copied to clipboard
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());
}
}
Content copied to clipboard
resources:
example:
type: aws:redshiftdata:Statement
properties:
clusterIdentifier: ${exampleAwsRedshiftCluster.clusterIdentifier}
database: ${exampleAwsRedshiftCluster.databaseName}
dbUser: ${exampleAwsRedshiftCluster.masterUsername}
sql: CREATE GROUP group_name;
Content copied to clipboard
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;",
});
Content copied to clipboard
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;")
Content copied to clipboard
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;",
});
});
Content copied to clipboard
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
})
}
Content copied to clipboard
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());
}
}
Content copied to clipboard
resources:
example:
type: aws:redshiftdata:Statement
properties:
workgroupName: ${exampleAwsRedshiftserverlessWorkgroup.workgroupName}
database: dev
sql: CREATE GROUP group_name;
Content copied to clipboard
Import
Using pulumi import
, import Redshift Data Statements using the id
. For example:
$ pulumi import aws:redshiftdata/statement:Statement example example
Content copied to clipboard
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
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
Link copied to clipboard
The name of the SQL statement. You can name the SQL statement when you create it to identify the query.
Link copied to clipboard
The serverless workgroup name. This parameter is required when connecting to a serverless workgroup and authenticating using either Secrets Manager or temporary credentials.