@pulumi/databricks
Version:
A Pulumi package for creating and managing databricks cloud resources.
182 lines • 6.93 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.AppsSettingsCustomTemplate = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* [](https://docs.databricks.com/aws/en/release-notes/release-types)
*
* Custom App Templates store the metadata of custom app code hosted in an external Git repository, enabling users to reuse boilerplate code when creating apps.
*
* ## Example Usage
*
* ### Basic Example
*
* This example creates a Custom Template in the workspace with the specified name.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const _this = new databricks.AppsSettingsCustomTemplate("this", {
* name: "my-custom-template",
* description: "A sample custom app template",
* gitRepo: "https://github.com/example/repo.git",
* path: "path-to-template",
* gitProvider: "github",
* manifest: {
* version: 1,
* name: "my-custom-app",
* },
* });
* ```
*
* ### Example with API Scopes
*
* This example creates a custom template that declares required user API scopes.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const apiScopesExample = new databricks.AppsSettingsCustomTemplate("api_scopes_example", {
* name: "my-api-template",
* description: "A template that requests user API scopes",
* gitRepo: "https://github.com/example/my-app.git",
* path: "templates/app",
* gitProvider: "github",
* manifest: {
* version: 1,
* name: "my-databricks-app",
* description: "This app requires the SQL API scope.",
* userApiScopes: ["sql"],
* },
* });
* ```
*
* ### Example with Resource Requirements
*
* This example defines a template that requests specific workspace resources with permissions granted.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const resourcesExample = new databricks.AppsSettingsCustomTemplate("resources_example", {
* name: "my-resource-template",
* description: "Template that requires secret and SQL warehouse access",
* gitRepo: "https://github.com/example/resource-app.git",
* path: "resource-template",
* gitProvider: "github",
* manifest: {
* version: 1,
* name: "resource-consuming-app",
* description: "This app requires access to a secret and SQL warehouse.",
* resourceSpecs: [
* {
* name: "my-secret",
* description: "A secret needed by the app",
* secretSpec: {
* permission: "READ",
* },
* },
* {
* name: "warehouse",
* description: "Warehouse access",
* sqlWarehouseSpec: {
* permission: "CAN_USE",
* },
* },
* ],
* },
* });
* ```
*
* ## Import
*
* As of Pulumi v1.5, resources can be imported through configuration.
*
* hcl
*
* import {
*
* id = "name"
*
* to = databricks_apps_settings_custom_template.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/appsSettingsCustomTemplate:AppsSettingsCustomTemplate this "name"
* ```
*/
class AppsSettingsCustomTemplate extends pulumi.CustomResource {
/**
* Get an existing AppsSettingsCustomTemplate 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 AppsSettingsCustomTemplate(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of AppsSettingsCustomTemplate. 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'] === AppsSettingsCustomTemplate.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["creator"] = state?.creator;
resourceInputs["description"] = state?.description;
resourceInputs["gitProvider"] = state?.gitProvider;
resourceInputs["gitRepo"] = state?.gitRepo;
resourceInputs["manifest"] = state?.manifest;
resourceInputs["name"] = state?.name;
resourceInputs["path"] = state?.path;
}
else {
const args = argsOrState;
if (args?.gitProvider === undefined && !opts.urn) {
throw new Error("Missing required property 'gitProvider'");
}
if (args?.gitRepo === undefined && !opts.urn) {
throw new Error("Missing required property 'gitRepo'");
}
if (args?.manifest === undefined && !opts.urn) {
throw new Error("Missing required property 'manifest'");
}
if (args?.path === undefined && !opts.urn) {
throw new Error("Missing required property 'path'");
}
resourceInputs["description"] = args?.description;
resourceInputs["gitProvider"] = args?.gitProvider;
resourceInputs["gitRepo"] = args?.gitRepo;
resourceInputs["manifest"] = args?.manifest;
resourceInputs["name"] = args?.name;
resourceInputs["path"] = args?.path;
resourceInputs["creator"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(AppsSettingsCustomTemplate.__pulumiType, name, resourceInputs, opts);
}
}
exports.AppsSettingsCustomTemplate = AppsSettingsCustomTemplate;
/** @internal */
AppsSettingsCustomTemplate.__pulumiType = 'databricks:index/appsSettingsCustomTemplate:AppsSettingsCustomTemplate';
//# sourceMappingURL=appsSettingsCustomTemplate.js.map