@pulumi/databricks
Version:
A Pulumi package for creating and managing databricks cloud resources.
119 lines • 5.78 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.MwsCredentials = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* 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.cloud.databricks.com/
* const databricksAccountId = config.requireObject<any>("databricksAccountId");
* // Names of created resources will be prefixed with this value
* const prefix = config.requireObject<any>("prefix");
* const _this = databricks.getAwsAssumeRolePolicy({
* externalId: databricksAccountId,
* });
* const crossAccountRole = new aws.iam.Role("cross_account_role", {
* name: `${prefix}-crossaccount`,
* assumeRolePolicy: _this.then(_this => _this.json),
* tags: tags,
* });
* const thisGetAwsCrossAccountPolicy = databricks.getAwsCrossAccountPolicy({});
* const thisRolePolicy = new aws.iam.RolePolicy("this", {
* name: `${prefix}-policy`,
* role: crossAccountRole.id,
* policy: thisGetAwsCrossAccountPolicy.then(thisGetAwsCrossAccountPolicy => thisGetAwsCrossAccountPolicy.json),
* });
* const thisMwsCredentials = new databricks.MwsCredentials("this", {
* credentialsName: `${prefix}-creds`,
* roleArn: crossAccountRole.arn,
* });
* ```
*
* ## Related Resources
*
* The following resources are used in the same context:
*
* * Provisioning Databricks on AWS guide.
* * databricks.MwsCustomerManagedKeys to configure KMS keys for 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 the combination of its identifier and the account id:
*
* bash
*
* ```sh
* $ pulumi import databricks:index/mwsCredentials:MwsCredentials this <account_id>/<credentials_id>
* ```
*/
class MwsCredentials extends pulumi.CustomResource {
/**
* Get an existing MwsCredentials 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 MwsCredentials(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of MwsCredentials. 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'] === MwsCredentials.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["accountId"] = state ? state.accountId : undefined;
resourceInputs["creationTime"] = state ? state.creationTime : undefined;
resourceInputs["credentialsId"] = state ? state.credentialsId : undefined;
resourceInputs["credentialsName"] = state ? state.credentialsName : undefined;
resourceInputs["externalId"] = state ? state.externalId : undefined;
resourceInputs["roleArn"] = state ? state.roleArn : undefined;
}
else {
const args = argsOrState;
if ((!args || args.credentialsName === undefined) && !opts.urn) {
throw new Error("Missing required property 'credentialsName'");
}
if ((!args || args.roleArn === undefined) && !opts.urn) {
throw new Error("Missing required property 'roleArn'");
}
resourceInputs["accountId"] = args ? args.accountId : undefined;
resourceInputs["creationTime"] = args ? args.creationTime : undefined;
resourceInputs["credentialsId"] = args ? args.credentialsId : undefined;
resourceInputs["credentialsName"] = args ? args.credentialsName : undefined;
resourceInputs["externalId"] = args ? args.externalId : undefined;
resourceInputs["roleArn"] = args ? args.roleArn : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(MwsCredentials.__pulumiType, name, resourceInputs, opts);
}
}
exports.MwsCredentials = MwsCredentials;
/** @internal */
MwsCredentials.__pulumiType = 'databricks:index/mwsCredentials:MwsCredentials';
//# sourceMappingURL=mwsCredentials.js.map
;