@pulumi/databricks
Version:
A Pulumi package for creating and managing databricks cloud resources.
92 lines • 4.25 kB
JavaScript
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.MwsNccBinding = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* > Initialize provider with `alias = "account"`, `host = "https://accounts.azuredatabricks.net"` and use `provider = databricks.account` for all `databricks_mws_*` resources.
*
* > This feature is available for AWS & Azure only, and is in [Public Preview](https://docs.databricks.com/release-notes/release-types.html) in AWS.
*
* Allows you to attach a Network Connectivity Config object to a databricks.MwsWorkspaces resource to create a [Databricks Workspace that leverages serverless network connectivity configs](https://learn.microsoft.com/en-us/azure/databricks/sql/admin/serverless-firewall).
*
* The NCC and workspace must be in the same region.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const config = new pulumi.Config();
* const region = config.requireObject<any>("region");
* const prefix = config.requireObject<any>("prefix");
* const ncc = new databricks.MwsNetworkConnectivityConfig("ncc", {
* name: `ncc-for-${prefix}`,
* region: region,
* });
* const nccBinding = new databricks.MwsNccBinding("ncc_binding", {
* networkConnectivityConfigId: ncc.networkConnectivityConfigId,
* workspaceId: databricksWorkspaceId,
* });
* ```
*
* ## Related Resources
*
* The following resources are used in the context:
*
* * databricks.MwsWorkspaces to set up Databricks workspaces.
* * databricks.MwsNetworkConnectivityConfig to create Network Connectivity Config objects.
*/
class MwsNccBinding extends pulumi.CustomResource {
/**
* Get an existing MwsNccBinding 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 MwsNccBinding(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of MwsNccBinding. 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'] === MwsNccBinding.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["networkConnectivityConfigId"] = state ? state.networkConnectivityConfigId : undefined;
resourceInputs["workspaceId"] = state ? state.workspaceId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.networkConnectivityConfigId === undefined) && !opts.urn) {
throw new Error("Missing required property 'networkConnectivityConfigId'");
}
if ((!args || args.workspaceId === undefined) && !opts.urn) {
throw new Error("Missing required property 'workspaceId'");
}
resourceInputs["networkConnectivityConfigId"] = args ? args.networkConnectivityConfigId : undefined;
resourceInputs["workspaceId"] = args ? args.workspaceId : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(MwsNccBinding.__pulumiType, name, resourceInputs, opts);
}
}
exports.MwsNccBinding = MwsNccBinding;
/** @internal */
MwsNccBinding.__pulumiType = 'databricks:index/mwsNccBinding:MwsNccBinding';
//# sourceMappingURL=mwsNccBinding.js.map
;