UNPKG

@pulumi/aws

Version:

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

92 lines 4.08 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.Database = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides an Athena database. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.s3.Bucket("example", {bucket: "example"}); * const exampleDatabase = new aws.athena.Database("example", { * name: "database_name", * bucket: example.id, * }); * ``` * * ## Import * * Using `pulumi import`, import Athena Databases using their name. For example: * * ```sh * $ pulumi import aws:athena/database:Database example example * ``` * Certain resource arguments, like `encryption_configuration` and `bucket`, do not have an API method for reading the information after creation. If the argument is set in the Pulumi program on an imported resource, Pulumi will always show a difference. To workaround this behavior, either omit the argument from the Pulumi program or use `ignore_changes` to hide the difference. For example: */ class Database extends pulumi.CustomResource { /** * Get an existing Database 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 Database(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of Database. 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'] === Database.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["aclConfiguration"] = state?.aclConfiguration; resourceInputs["bucket"] = state?.bucket; resourceInputs["comment"] = state?.comment; resourceInputs["encryptionConfiguration"] = state?.encryptionConfiguration; resourceInputs["expectedBucketOwner"] = state?.expectedBucketOwner; resourceInputs["forceDestroy"] = state?.forceDestroy; resourceInputs["name"] = state?.name; resourceInputs["properties"] = state?.properties; resourceInputs["region"] = state?.region; resourceInputs["workgroup"] = state?.workgroup; } else { const args = argsOrState; resourceInputs["aclConfiguration"] = args?.aclConfiguration; resourceInputs["bucket"] = args?.bucket; resourceInputs["comment"] = args?.comment; resourceInputs["encryptionConfiguration"] = args?.encryptionConfiguration; resourceInputs["expectedBucketOwner"] = args?.expectedBucketOwner; resourceInputs["forceDestroy"] = args?.forceDestroy; resourceInputs["name"] = args?.name; resourceInputs["properties"] = args?.properties; resourceInputs["region"] = args?.region; resourceInputs["workgroup"] = args?.workgroup; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Database.__pulumiType, name, resourceInputs, opts); } } exports.Database = Database; /** @internal */ Database.__pulumiType = 'aws:athena/database:Database'; //# sourceMappingURL=database.js.map