@pulumiverse/grafana
Version:
A Pulumi package for creating and managing grafana.
243 lines • 7.92 kB
JavaScript
"use strict";
// *** 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.ProvisioningRepository = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../../utilities");
/**
* Manages Grafana Git Sync repositories for provisioning dashboards and related resources.
*
* ## Example Usage
*
* ### GitHub Repository with Token Authentication
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as grafana from "@pulumiverse/grafana";
*
* const example = new grafana.apps.v0alpha1.ProvisioningRepository("example", {
* metadata: {
* uid: "my-github-folder-repo",
* },
* spec: {
* title: "My GitHub Folder Repository",
* description: "Folder-scoped GitHub repository authenticated directly with a token",
* type: "github",
* workflows: [
* "write",
* "branch",
* ],
* sync: {
* enabled: true,
* target: "folder",
* intervalSeconds: 60,
* },
* github: {
* url: "https://github.com/example/grafana-dashboards",
* branch: "main",
* path: "grafanatftest",
* },
* webhook: {
* baseUrl: "https://grafana.example.com",
* },
* },
* secure: {
* token: {
* create: "replace-me",
* },
* },
* secureVersion: 1,
* });
* ```
*
* ### Bitbucket Repository with Token Authentication - Enterprise/Cloud only
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as grafana from "@pulumiverse/grafana";
*
* const bitbucketToken = new grafana.apps.v0alpha1.ProvisioningRepository("bitbucket_token", {
* metadata: {
* uid: "my-bitbucket-folder-repo",
* },
* spec: {
* title: "My Bitbucket Folder Repository",
* description: "Folder-scoped Bitbucket repository authenticated directly with an Atlassian API token",
* type: "bitbucket",
* workflows: [
* "write",
* "branch",
* ],
* sync: {
* enabled: true,
* target: "folder",
* intervalSeconds: 60,
* },
* bitbucket: {
* url: "https://bitbucket.org/example/grafana-dashboards",
* branch: "main",
* path: "grafanatftest",
* tokenUser: "x-bitbucket-api-token-auth",
* },
* },
* secure: {
* token: {
* create: "replace-me",
* },
* },
* secureVersion: 1,
* });
* ```
*
* ### GitLab Repository with Token Authentication - Enterprise/Cloud only
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as grafana from "@pulumiverse/grafana";
*
* const gitlabToken = new grafana.apps.v0alpha1.ProvisioningRepository("gitlab_token", {
* metadata: {
* uid: "my-gitlab-folder-repo",
* },
* spec: {
* title: "My GitLab Folder Repository",
* description: "Folder-scoped GitLab repository authenticated directly with a token",
* type: "gitlab",
* workflows: [
* "write",
* "branch",
* ],
* sync: {
* enabled: true,
* target: "folder",
* intervalSeconds: 60,
* },
* gitlab: {
* url: "https://gitlab.com/example/grafana-dashboards",
* branch: "main",
* path: "grafanatftest",
* },
* },
* secure: {
* token: {
* create: "replace-me",
* },
* },
* secureVersion: 1,
* });
* ```
*
* ### Generic Git Repository
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as grafana from "@pulumiverse/grafana";
*
* const pureGit = new grafana.apps.v0alpha1.ProvisioningRepository("pure_git", {
* metadata: {
* uid: "my-pure-git-folder-repo",
* },
* spec: {
* title: "My Pure Git Folder Repository",
* description: "Folder-scoped generic Git repository authenticated with a token",
* type: "git",
* workflows: ["write"],
* sync: {
* enabled: true,
* target: "folder",
* intervalSeconds: 60,
* },
* git: {
* url: "https://git.example.com/platform/dashboards.git",
* branch: "main",
* path: "grafanatftest",
* tokenUser: "git",
* },
* },
* secure: {
* token: {
* create: "replace-me",
* },
* },
* secureVersion: 1,
* });
* ```
*
* ### Local Filesystem Repository
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as grafana from "@pulumiverse/grafana";
*
* const localRepo = new grafana.apps.v0alpha1.ProvisioningRepository("local_repo", {
* metadata: {
* uid: "my-local-folder-repo",
* },
* spec: {
* title: "My Local Folder Repository",
* description: "Folder-scoped local filesystem repository",
* type: "local",
* workflows: ["write"],
* sync: {
* enabled: true,
* target: "folder",
* intervalSeconds: 60,
* },
* local: {
* path: "/usr/share/grafana/conf/provisioning/my-local-repo",
* },
* },
* });
* ```
*/
class ProvisioningRepository extends pulumi.CustomResource {
/**
* Get an existing ProvisioningRepository 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 ProvisioningRepository(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of ProvisioningRepository. 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'] === ProvisioningRepository.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["metadata"] = state?.metadata;
resourceInputs["options"] = state?.options;
resourceInputs["secure"] = state?.secure;
resourceInputs["secureVersion"] = state?.secureVersion;
resourceInputs["spec"] = state?.spec;
}
else {
const args = argsOrState;
resourceInputs["metadata"] = args?.metadata;
resourceInputs["options"] = args?.options;
resourceInputs["secure"] = args?.secure;
resourceInputs["secureVersion"] = args?.secureVersion;
resourceInputs["spec"] = args?.spec;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ProvisioningRepository.__pulumiType, name, resourceInputs, opts);
}
}
exports.ProvisioningRepository = ProvisioningRepository;
/** @internal */
ProvisioningRepository.__pulumiType = 'grafana:apps/v0alpha1/provisioningRepository:ProvisioningRepository';
//# sourceMappingURL=provisioningRepository.js.map