@pulumi/databricks
Version:
A Pulumi package for creating and managing databricks cloud resources.
153 lines • 6.58 kB
JavaScript
;
// *** 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.MwsCustomerManagedKeys = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* ## Example Usage
*
* > If you've used the resource before, please add `useCases = ["MANAGED_SERVICES"]` to keep the previous behaviour.
*
* ### Customer-managed key for managed services
*
* You must configure this during workspace creation
*
* ### For GCP
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const config = new pulumi.Config();
* // Account Id that could be found in the top right corner of https://accounts.gcp.databricks.com/
* const databricksAccountId = config.requireObject<any>("databricksAccountId");
* // Id of a google_kms_crypto_key
* const cmekResourceId = config.requireObject<any>("cmekResourceId");
* const managedServices = new databricks.MwsCustomerManagedKeys("managed_services", {
* accountId: databricksAccountId,
* gcpKeyInfo: {
* kmsKeyId: cmekResourceId,
* },
* useCases: ["MANAGED_SERVICES"],
* });
* ```
*
* ### Customer-managed key for workspace storage
*
* ### For GCP
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const config = new pulumi.Config();
* // Account Id that could be found in the top right corner of https://accounts.gcp.databricks.com/
* const databricksAccountId = config.requireObject<any>("databricksAccountId");
* // Id of a google_kms_crypto_key
* const cmekResourceId = config.requireObject<any>("cmekResourceId");
* const storage = new databricks.MwsCustomerManagedKeys("storage", {
* accountId: databricksAccountId,
* gcpKeyInfo: {
* kmsKeyId: cmekResourceId,
* },
* useCases: ["STORAGE"],
* });
* ```
*
* ## Related Resources
*
* The following resources are used in the same context:
*
* * Provisioning Databricks on AWS guide.
* * databricks.MwsCredentials to configure the cross-account role for creation of new workspaces within AWS.
* * databricks.MwsLogDelivery to configure delivery of [billable usage logs](https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html) and [audit logs](https://docs.databricks.com/administration-guide/account-settings/audit-logs.html).
* * databricks.MwsNetworks to [configure VPC](https://docs.databricks.com/administration-guide/cloud-configurations/aws/customer-managed-vpc.html) & subnets for new workspaces within AWS.
* * databricks.MwsStorageConfigurations to configure root bucket new workspaces within AWS.
* * databricks.MwsWorkspaces to set up [AWS and GCP workspaces](https://docs.databricks.com/getting-started/overview.html#e2-architecture-1).
*
* ## Import
*
* This resource can be imported by Databricks account ID and customer managed key ID.
*
* hcl
*
* import {
*
* to = databricks_mws_customer_managed_keys.this
*
* id = "<account_id>/<customer_managed_key_id>"
*
* }
*
* Alternatively, when using `terraform` version 1.4 or earlier, import using the `pulumi import` command:
*
* ```sh
* $ pulumi import databricks:index/mwsCustomerManagedKeys:MwsCustomerManagedKeys this '<account_id>/<customer_managed_key_id>'
* ```
*
* ~> This resource does not support updates. If your configuration does not match the existing resource,
*
* the next `pulumi up` will cause the resource to be destroyed and recreated. After importing,
*
* verify that the configuration matches the existing resource by running `pulumi preview`.
*/
class MwsCustomerManagedKeys extends pulumi.CustomResource {
/**
* Get an existing MwsCustomerManagedKeys 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 MwsCustomerManagedKeys(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of MwsCustomerManagedKeys. 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'] === MwsCustomerManagedKeys.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["accountId"] = state?.accountId;
resourceInputs["awsKeyInfo"] = state?.awsKeyInfo;
resourceInputs["creationTime"] = state?.creationTime;
resourceInputs["customerManagedKeyId"] = state?.customerManagedKeyId;
resourceInputs["gcpKeyInfo"] = state?.gcpKeyInfo;
resourceInputs["useCases"] = state?.useCases;
}
else {
const args = argsOrState;
if (args?.accountId === undefined && !opts.urn) {
throw new Error("Missing required property 'accountId'");
}
if (args?.useCases === undefined && !opts.urn) {
throw new Error("Missing required property 'useCases'");
}
resourceInputs["accountId"] = args?.accountId;
resourceInputs["awsKeyInfo"] = args?.awsKeyInfo;
resourceInputs["creationTime"] = args?.creationTime;
resourceInputs["customerManagedKeyId"] = args?.customerManagedKeyId;
resourceInputs["gcpKeyInfo"] = args?.gcpKeyInfo;
resourceInputs["useCases"] = args?.useCases;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(MwsCustomerManagedKeys.__pulumiType, name, resourceInputs, opts);
}
}
exports.MwsCustomerManagedKeys = MwsCustomerManagedKeys;
/** @internal */
MwsCustomerManagedKeys.__pulumiType = 'databricks:index/mwsCustomerManagedKeys:MwsCustomerManagedKeys';
//# sourceMappingURL=mwsCustomerManagedKeys.js.map