@pulumi/databricks
Version:
A Pulumi package for creating and managing databricks cloud resources.
90 lines • 4.12 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.ServicePrincipalRole = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* This resource allows you to attach a role or databricks.InstanceProfile (AWS) to a databricks_service_principal.
*
* ## Example Usage
*
* Granting a service principal access to an instance profile
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const instanceProfile = new databricks.InstanceProfile("instance_profile", {instanceProfileArn: "my_instance_profile_arn"});
* const _this = new databricks.ServicePrincipal("this", {displayName: "My Service Principal"});
* const myServicePrincipalInstanceProfile = new databricks.ServicePrincipalRole("my_service_principal_instance_profile", {
* servicePrincipalId: _this.id,
* role: instanceProfile.id,
* });
* ```
*
* ## Related Resources
*
* The following resources are often used in the same context:
*
* * End to end workspace management guide.
* * databricks.UserRole to attach role or databricks.InstanceProfile (AWS) to databricks_user.
* * databricks.GroupInstanceProfile to attach databricks.InstanceProfile (AWS) to databricks_group.
* * databricks.GroupMember to attach users and groups as group members.
* * databricks.InstanceProfile to manage AWS EC2 instance profiles that users can launch databricks.Cluster and access data, like databricks_mount.
*
* ## Import
*
* !> Importing this resource is not currently supported.
*/
class ServicePrincipalRole extends pulumi.CustomResource {
/**
* Get an existing ServicePrincipalRole 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 ServicePrincipalRole(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of ServicePrincipalRole. 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'] === ServicePrincipalRole.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["role"] = state ? state.role : undefined;
resourceInputs["servicePrincipalId"] = state ? state.servicePrincipalId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.role === undefined) && !opts.urn) {
throw new Error("Missing required property 'role'");
}
if ((!args || args.servicePrincipalId === undefined) && !opts.urn) {
throw new Error("Missing required property 'servicePrincipalId'");
}
resourceInputs["role"] = args ? args.role : undefined;
resourceInputs["servicePrincipalId"] = args ? args.servicePrincipalId : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ServicePrincipalRole.__pulumiType, name, resourceInputs, opts);
}
}
exports.ServicePrincipalRole = ServicePrincipalRole;
/** @internal */
ServicePrincipalRole.__pulumiType = 'databricks:index/servicePrincipalRole:ServicePrincipalRole';
//# sourceMappingURL=servicePrincipalRole.js.map
;