@pulumiverse/grafana
Version:
A Pulumi package for creating and managing grafana.
96 lines • 3.76 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.McpServer = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a Grafana Assistant MCP server integration.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as grafana from "@pulumiverse/grafana";
*
* const config = new pulumi.Config();
* const mcpToken = config.require("mcpToken");
* const example = new grafana.assistant.McpServer("example", {
* name: "Example MCP server",
* scope: "tenant",
* applications: ["assistant"],
* configuration: {
* url: "https://example.com/mcp/",
* },
* customHeaders: {
* Authorization: `Bearer ${mcpToken}`,
* },
* });
* ```
*
* ## Import
*
* ```sh
* terraform import grafana_assistant_mcp_server.name "{{ id }}"
* ```
*/
class McpServer extends pulumi.CustomResource {
/**
* Get an existing McpServer 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 McpServer(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of McpServer. 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'] === McpServer.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["applications"] = state?.applications;
resourceInputs["configuration"] = state?.configuration;
resourceInputs["customHeaders"] = state?.customHeaders;
resourceInputs["description"] = state?.description;
resourceInputs["enabled"] = state?.enabled;
resourceInputs["name"] = state?.name;
resourceInputs["scope"] = state?.scope;
}
else {
const args = argsOrState;
if (args?.scope === undefined && !opts.urn) {
throw new Error("Missing required property 'scope'");
}
resourceInputs["applications"] = args?.applications;
resourceInputs["configuration"] = args?.configuration;
resourceInputs["customHeaders"] = args?.customHeaders ? pulumi.secret(args.customHeaders) : undefined;
resourceInputs["description"] = args?.description;
resourceInputs["enabled"] = args?.enabled;
resourceInputs["name"] = args?.name;
resourceInputs["scope"] = args?.scope;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["customHeaders"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(McpServer.__pulumiType, name, resourceInputs, opts);
}
}
exports.McpServer = McpServer;
/** @internal */
McpServer.__pulumiType = 'grafana:assistant/mcpServer:McpServer';
//# sourceMappingURL=mcpServer.js.map