UNPKG

@pulumi/aws

Version:

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

110 lines 4.34 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.NamedQuery = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides an Athena Named Query resource. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const hoge = new aws.s3.Bucket("hoge", {bucket: "tf-test"}); * const test = new aws.kms.Key("test", { * deletionWindowInDays: 7, * description: "Athena KMS Key", * }); * const testWorkgroup = new aws.athena.Workgroup("test", { * name: "example", * configuration: { * resultConfiguration: { * encryptionConfiguration: { * encryptionOption: "SSE_KMS", * kmsKeyArn: test.arn, * }, * }, * }, * }); * const hogeDatabase = new aws.athena.Database("hoge", { * name: "users", * bucket: hoge.id, * }); * const foo = new aws.athena.NamedQuery("foo", { * name: "bar", * workgroup: testWorkgroup.id, * database: hogeDatabase.name, * query: pulumi.interpolate`SELECT * FROM ${hogeDatabase.name} limit 10;`, * }); * ``` * * ## Import * * Using `pulumi import`, import Athena Named Query using the query ID. For example: * * ```sh * $ pulumi import aws:athena/namedQuery:NamedQuery example 0123456789 * ``` */ class NamedQuery extends pulumi.CustomResource { /** * Get an existing NamedQuery 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 NamedQuery(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of NamedQuery. 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'] === NamedQuery.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["database"] = state ? state.database : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["query"] = state ? state.query : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["workgroup"] = state ? state.workgroup : undefined; } else { const args = argsOrState; if ((!args || args.database === undefined) && !opts.urn) { throw new Error("Missing required property 'database'"); } if ((!args || args.query === undefined) && !opts.urn) { throw new Error("Missing required property 'query'"); } resourceInputs["database"] = args ? args.database : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["query"] = args ? args.query : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["workgroup"] = args ? args.workgroup : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(NamedQuery.__pulumiType, name, resourceInputs, opts); } } exports.NamedQuery = NamedQuery; /** @internal */ NamedQuery.__pulumiType = 'aws:athena/namedQuery:NamedQuery'; //# sourceMappingURL=namedQuery.js.map