UNPKG

@pulumi/databricks

Version:

A Pulumi package for creating and managing databricks cloud resources.

165 lines 7.1 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.DatabaseInstance = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Lakebase Database Instances are managed Postgres instances, composed of a primary Postgres compute instance and 0 or more read replica instances. * * ## Example Usage * * ### Basic Example * * This example creates a simple Database Instance with the specified name and capacity. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as databricks from "@pulumi/databricks"; * * const _this = new databricks.DatabaseInstance("this", { * name: "my-database-instance", * capacity: "CU_2", * }); * ``` * * ### Example with Readable Secondaries * * This example creates a Database Instance with readable secondaries (and HA) enabled. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as databricks from "@pulumi/databricks"; * * const _this = new databricks.DatabaseInstance("this", { * name: "my-database-instance", * capacity: "CU_2", * nodeCount: 2, * enableReadableSecondaries: true, * }); * ``` * * ### Example Child Instance Created From Parent * * This example creates a child Database Instance from a specified parent Database Instance at the current point in time. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as databricks from "@pulumi/databricks"; * * const child = new databricks.DatabaseInstance("child", { * name: "my-database-instance", * capacity: "CU_2", * parentInstanceRef: { * name: "my-parent-instance", * }, * }); * ``` * * ## Import * * As of Pulumi v1.5, resources can be imported through configuration. * * hcl * * import { * * id = "name" * * to = databricks_database_instance.this * * } * * If you are using an older version of Pulumi, import the resource using the `pulumi import` command as follows: * * ```sh * $ pulumi import databricks:index/databaseInstance:DatabaseInstance databricks_database_instance "name" * ``` */ class DatabaseInstance extends pulumi.CustomResource { /** * Get an existing DatabaseInstance 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 DatabaseInstance(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of DatabaseInstance. 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'] === DatabaseInstance.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["capacity"] = state?.capacity; resourceInputs["childInstanceRefs"] = state?.childInstanceRefs; resourceInputs["creationTime"] = state?.creationTime; resourceInputs["creator"] = state?.creator; resourceInputs["effectiveEnablePgNativeLogin"] = state?.effectiveEnablePgNativeLogin; resourceInputs["effectiveEnableReadableSecondaries"] = state?.effectiveEnableReadableSecondaries; resourceInputs["effectiveNodeCount"] = state?.effectiveNodeCount; resourceInputs["effectiveRetentionWindowInDays"] = state?.effectiveRetentionWindowInDays; resourceInputs["effectiveStopped"] = state?.effectiveStopped; resourceInputs["enablePgNativeLogin"] = state?.enablePgNativeLogin; resourceInputs["enableReadableSecondaries"] = state?.enableReadableSecondaries; resourceInputs["name"] = state?.name; resourceInputs["nodeCount"] = state?.nodeCount; resourceInputs["parentInstanceRef"] = state?.parentInstanceRef; resourceInputs["pgVersion"] = state?.pgVersion; resourceInputs["purgeOnDelete"] = state?.purgeOnDelete; resourceInputs["readOnlyDns"] = state?.readOnlyDns; resourceInputs["readWriteDns"] = state?.readWriteDns; resourceInputs["retentionWindowInDays"] = state?.retentionWindowInDays; resourceInputs["state"] = state?.state; resourceInputs["stopped"] = state?.stopped; resourceInputs["uid"] = state?.uid; resourceInputs["workspaceId"] = state?.workspaceId; } else { const args = argsOrState; resourceInputs["capacity"] = args?.capacity; resourceInputs["enablePgNativeLogin"] = args?.enablePgNativeLogin; resourceInputs["enableReadableSecondaries"] = args?.enableReadableSecondaries; resourceInputs["name"] = args?.name; resourceInputs["nodeCount"] = args?.nodeCount; resourceInputs["parentInstanceRef"] = args?.parentInstanceRef; resourceInputs["purgeOnDelete"] = args?.purgeOnDelete; resourceInputs["retentionWindowInDays"] = args?.retentionWindowInDays; resourceInputs["stopped"] = args?.stopped; resourceInputs["workspaceId"] = args?.workspaceId; resourceInputs["childInstanceRefs"] = undefined /*out*/; resourceInputs["creationTime"] = undefined /*out*/; resourceInputs["creator"] = undefined /*out*/; resourceInputs["effectiveEnablePgNativeLogin"] = undefined /*out*/; resourceInputs["effectiveEnableReadableSecondaries"] = undefined /*out*/; resourceInputs["effectiveNodeCount"] = undefined /*out*/; resourceInputs["effectiveRetentionWindowInDays"] = undefined /*out*/; resourceInputs["effectiveStopped"] = undefined /*out*/; resourceInputs["pgVersion"] = undefined /*out*/; resourceInputs["readOnlyDns"] = undefined /*out*/; resourceInputs["readWriteDns"] = undefined /*out*/; resourceInputs["state"] = undefined /*out*/; resourceInputs["uid"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(DatabaseInstance.__pulumiType, name, resourceInputs, opts); } } exports.DatabaseInstance = DatabaseInstance; /** @internal */ DatabaseInstance.__pulumiType = 'databricks:index/databaseInstance:DatabaseInstance'; //# sourceMappingURL=databaseInstance.js.map