UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

113 lines 4.41 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.Statement = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Executes a Redshift Data Statement. * * ## Example Usage * * ### clusterIdentifier * * ```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;", * }); * ``` * * ### workgroupName * * ```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;", * }); * ``` * * ## Import * * Using `pulumi import`, import Redshift Data Statements using the `id`. For example: * * ```sh * $ pulumi import aws:redshiftdata/statement:Statement example example * ``` */ class Statement extends pulumi.CustomResource { /** * Get an existing Statement resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name, id, state, opts) { return new Statement(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of Statement. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === Statement.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["clusterIdentifier"] = state?.clusterIdentifier; resourceInputs["database"] = state?.database; resourceInputs["dbUser"] = state?.dbUser; resourceInputs["parameters"] = state?.parameters; resourceInputs["region"] = state?.region; resourceInputs["secretArn"] = state?.secretArn; resourceInputs["sql"] = state?.sql; resourceInputs["statementName"] = state?.statementName; resourceInputs["withEvent"] = state?.withEvent; resourceInputs["workgroupName"] = state?.workgroupName; } else { const args = argsOrState; if (args?.database === undefined && !opts.urn) { throw new Error("Missing required property 'database'"); } if (args?.sql === undefined && !opts.urn) { throw new Error("Missing required property 'sql'"); } resourceInputs["clusterIdentifier"] = args?.clusterIdentifier; resourceInputs["database"] = args?.database; resourceInputs["dbUser"] = args?.dbUser; resourceInputs["parameters"] = args?.parameters; resourceInputs["region"] = args?.region; resourceInputs["secretArn"] = args?.secretArn; resourceInputs["sql"] = args?.sql; resourceInputs["statementName"] = args?.statementName; resourceInputs["withEvent"] = args?.withEvent; resourceInputs["workgroupName"] = args?.workgroupName; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Statement.__pulumiType, name, resourceInputs, opts); } } exports.Statement = Statement; /** @internal */ Statement.__pulumiType = 'aws:redshiftdata/statement:Statement'; //# sourceMappingURL=statement.js.map