@pulumi/databricks
Version:
A Pulumi package for creating and managing databricks cloud resources.
424 lines (423 loc) • 16.1 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
/**
* [](https://docs.databricks.com/aws/en/release-notes/release-types)
*
* 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",
* },
* });
* ```
*
* ### Example with a usage policy and custom tags
*
* This example creates a Database Instance with an associated usage policy and custom tags.
*
* ```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_8",
* usagePolicyId: "948192fa-a98b-498f-a09b-ecee79d8b983",
* customTags: [
* {
* key: "custom_tag_key1",
* value: "custom_tag_value1",
* },
* {
* key: "custom_tag_key2",
* value: "custom_tag_value2",
* },
* ],
* });
* ```
*
* ## 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 this "name"
* ```
*/
export declare 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: string, id: pulumi.Input<pulumi.ID>, state?: DatabaseInstanceState, opts?: pulumi.CustomResourceOptions): DatabaseInstance;
/**
* 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: any): obj is DatabaseInstance;
/**
* The sku of the instance. Valid values are "CU_1", "CU_2", "CU_4", "CU_8"
*/
readonly capacity: pulumi.Output<string | undefined>;
/**
* (list of DatabaseInstanceRef) - The refs of the child instances. This is only available if the instance is
* parent instance
*/
readonly childInstanceRefs: pulumi.Output<outputs.DatabaseInstanceChildInstanceRef[]>;
/**
* (string) - The timestamp when the instance was created
*/
readonly creationTime: pulumi.Output<string>;
/**
* (string) - The email of the creator of the instance
*/
readonly creator: pulumi.Output<string>;
/**
* Custom tags associated with the instance. This field is only included on create and update responses
*/
readonly customTags: pulumi.Output<outputs.DatabaseInstanceCustomTag[]>;
/**
* (string, deprecated) - Deprecated. The sku of the instance; this field will always match the value of capacity
*/
readonly effectiveCapacity: pulumi.Output<string>;
/**
* (list of CustomTag) - The recorded custom tags associated with the instance
*/
readonly effectiveCustomTags: pulumi.Output<outputs.DatabaseInstanceEffectiveCustomTag[]>;
/**
* (boolean) - Whether the instance has PG native password login enabled
*/
readonly effectiveEnablePgNativeLogin: pulumi.Output<boolean>;
/**
* (boolean) - Whether secondaries serving read-only traffic are enabled. Defaults to false
*/
readonly effectiveEnableReadableSecondaries: pulumi.Output<boolean>;
/**
* (integer) - The number of nodes in the instance, composed of 1 primary and 0 or more secondaries. Defaults to
* 1 primary and 0 secondaries
*/
readonly effectiveNodeCount: pulumi.Output<number>;
/**
* (integer) - The retention window for the instance. This is the time window in days
* for which the historical data is retained
*/
readonly effectiveRetentionWindowInDays: pulumi.Output<number>;
/**
* (boolean) - Whether the instance is stopped
*/
readonly effectiveStopped: pulumi.Output<boolean>;
/**
* (string) - The policy that is applied to the instance
*/
readonly effectiveUsagePolicyId: pulumi.Output<string>;
/**
* Whether to enable PG native password login on the instance. Defaults to false
*/
readonly enablePgNativeLogin: pulumi.Output<boolean>;
/**
* Whether to enable secondaries to serve read-only traffic. Defaults to false
*/
readonly enableReadableSecondaries: pulumi.Output<boolean>;
/**
* The name of the instance. This is the unique identifier for the instance
*/
readonly name: pulumi.Output<string>;
/**
* The number of nodes in the instance, composed of 1 primary and 0 or more secondaries. Defaults to
* 1 primary and 0 secondaries. This field is input only, see effectiveNodeCount for the output
*/
readonly nodeCount: pulumi.Output<number>;
/**
* The ref of the parent instance. This is only available if the instance is
* child instance.
* Input: For specifying the parent instance to create a child instance. Optional.
* Output: Only populated if provided as input to create a child instance
*/
readonly parentInstanceRef: pulumi.Output<outputs.DatabaseInstanceParentInstanceRef | undefined>;
/**
* (string) - The version of Postgres running on the instance
*/
readonly pgVersion: pulumi.Output<string>;
/**
* Purge the resource on delete
*/
readonly purgeOnDelete: pulumi.Output<boolean | undefined>;
/**
* (string) - The DNS endpoint to connect to the instance for read only access. This is only available if
* enableReadableSecondaries is true
*/
readonly readOnlyDns: pulumi.Output<string>;
/**
* (string) - The DNS endpoint to connect to the instance for read+write access
*/
readonly readWriteDns: pulumi.Output<string>;
/**
* The retention window for the instance. This is the time window in days
* for which the historical data is retained. The default value is 7 days.
* Valid values are 2 to 35 days
*/
readonly retentionWindowInDays: pulumi.Output<number>;
/**
* (string) - The current state of the instance. Possible values are: `AVAILABLE`, `DELETING`, `FAILING_OVER`, `STARTING`, `STOPPED`, `UPDATING`
*/
readonly state: pulumi.Output<string>;
/**
* Whether to stop the instance. An input only param, see effectiveStopped for the output
*/
readonly stopped: pulumi.Output<boolean>;
/**
* (string) - Id of the ref database instance
*/
readonly uid: pulumi.Output<string>;
/**
* The desired usage policy to associate with the instance
*/
readonly usagePolicyId: pulumi.Output<string>;
/**
* Create a DatabaseInstance resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args?: DatabaseInstanceArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering DatabaseInstance resources.
*/
export interface DatabaseInstanceState {
/**
* The sku of the instance. Valid values are "CU_1", "CU_2", "CU_4", "CU_8"
*/
capacity?: pulumi.Input<string>;
/**
* (list of DatabaseInstanceRef) - The refs of the child instances. This is only available if the instance is
* parent instance
*/
childInstanceRefs?: pulumi.Input<pulumi.Input<inputs.DatabaseInstanceChildInstanceRef>[]>;
/**
* (string) - The timestamp when the instance was created
*/
creationTime?: pulumi.Input<string>;
/**
* (string) - The email of the creator of the instance
*/
creator?: pulumi.Input<string>;
/**
* Custom tags associated with the instance. This field is only included on create and update responses
*/
customTags?: pulumi.Input<pulumi.Input<inputs.DatabaseInstanceCustomTag>[]>;
/**
* (string, deprecated) - Deprecated. The sku of the instance; this field will always match the value of capacity
*/
effectiveCapacity?: pulumi.Input<string>;
/**
* (list of CustomTag) - The recorded custom tags associated with the instance
*/
effectiveCustomTags?: pulumi.Input<pulumi.Input<inputs.DatabaseInstanceEffectiveCustomTag>[]>;
/**
* (boolean) - Whether the instance has PG native password login enabled
*/
effectiveEnablePgNativeLogin?: pulumi.Input<boolean>;
/**
* (boolean) - Whether secondaries serving read-only traffic are enabled. Defaults to false
*/
effectiveEnableReadableSecondaries?: pulumi.Input<boolean>;
/**
* (integer) - The number of nodes in the instance, composed of 1 primary and 0 or more secondaries. Defaults to
* 1 primary and 0 secondaries
*/
effectiveNodeCount?: pulumi.Input<number>;
/**
* (integer) - The retention window for the instance. This is the time window in days
* for which the historical data is retained
*/
effectiveRetentionWindowInDays?: pulumi.Input<number>;
/**
* (boolean) - Whether the instance is stopped
*/
effectiveStopped?: pulumi.Input<boolean>;
/**
* (string) - The policy that is applied to the instance
*/
effectiveUsagePolicyId?: pulumi.Input<string>;
/**
* Whether to enable PG native password login on the instance. Defaults to false
*/
enablePgNativeLogin?: pulumi.Input<boolean>;
/**
* Whether to enable secondaries to serve read-only traffic. Defaults to false
*/
enableReadableSecondaries?: pulumi.Input<boolean>;
/**
* The name of the instance. This is the unique identifier for the instance
*/
name?: pulumi.Input<string>;
/**
* The number of nodes in the instance, composed of 1 primary and 0 or more secondaries. Defaults to
* 1 primary and 0 secondaries. This field is input only, see effectiveNodeCount for the output
*/
nodeCount?: pulumi.Input<number>;
/**
* The ref of the parent instance. This is only available if the instance is
* child instance.
* Input: For specifying the parent instance to create a child instance. Optional.
* Output: Only populated if provided as input to create a child instance
*/
parentInstanceRef?: pulumi.Input<inputs.DatabaseInstanceParentInstanceRef>;
/**
* (string) - The version of Postgres running on the instance
*/
pgVersion?: pulumi.Input<string>;
/**
* Purge the resource on delete
*/
purgeOnDelete?: pulumi.Input<boolean>;
/**
* (string) - The DNS endpoint to connect to the instance for read only access. This is only available if
* enableReadableSecondaries is true
*/
readOnlyDns?: pulumi.Input<string>;
/**
* (string) - The DNS endpoint to connect to the instance for read+write access
*/
readWriteDns?: pulumi.Input<string>;
/**
* The retention window for the instance. This is the time window in days
* for which the historical data is retained. The default value is 7 days.
* Valid values are 2 to 35 days
*/
retentionWindowInDays?: pulumi.Input<number>;
/**
* (string) - The current state of the instance. Possible values are: `AVAILABLE`, `DELETING`, `FAILING_OVER`, `STARTING`, `STOPPED`, `UPDATING`
*/
state?: pulumi.Input<string>;
/**
* Whether to stop the instance. An input only param, see effectiveStopped for the output
*/
stopped?: pulumi.Input<boolean>;
/**
* (string) - Id of the ref database instance
*/
uid?: pulumi.Input<string>;
/**
* The desired usage policy to associate with the instance
*/
usagePolicyId?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a DatabaseInstance resource.
*/
export interface DatabaseInstanceArgs {
/**
* The sku of the instance. Valid values are "CU_1", "CU_2", "CU_4", "CU_8"
*/
capacity?: pulumi.Input<string>;
/**
* Custom tags associated with the instance. This field is only included on create and update responses
*/
customTags?: pulumi.Input<pulumi.Input<inputs.DatabaseInstanceCustomTag>[]>;
/**
* Whether to enable PG native password login on the instance. Defaults to false
*/
enablePgNativeLogin?: pulumi.Input<boolean>;
/**
* Whether to enable secondaries to serve read-only traffic. Defaults to false
*/
enableReadableSecondaries?: pulumi.Input<boolean>;
/**
* The name of the instance. This is the unique identifier for the instance
*/
name?: pulumi.Input<string>;
/**
* The number of nodes in the instance, composed of 1 primary and 0 or more secondaries. Defaults to
* 1 primary and 0 secondaries. This field is input only, see effectiveNodeCount for the output
*/
nodeCount?: pulumi.Input<number>;
/**
* The ref of the parent instance. This is only available if the instance is
* child instance.
* Input: For specifying the parent instance to create a child instance. Optional.
* Output: Only populated if provided as input to create a child instance
*/
parentInstanceRef?: pulumi.Input<inputs.DatabaseInstanceParentInstanceRef>;
/**
* Purge the resource on delete
*/
purgeOnDelete?: pulumi.Input<boolean>;
/**
* The retention window for the instance. This is the time window in days
* for which the historical data is retained. The default value is 7 days.
* Valid values are 2 to 35 days
*/
retentionWindowInDays?: pulumi.Input<number>;
/**
* Whether to stop the instance. An input only param, see effectiveStopped for the output
*/
stopped?: pulumi.Input<boolean>;
/**
* The desired usage policy to associate with the instance
*/
usagePolicyId?: pulumi.Input<string>;
}