@pulumiverse/grafana
Version:
A Pulumi package for creating and managing grafana.
174 lines • 6.17 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.ProfileConfig = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages Knowledge Graph Profile Configuration through Grafana API.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as grafana from "@pulumiverse/grafana";
*
* const production = new grafana.assert.ProfileConfig("production", {
* name: "production",
* priority: 1000,
* defaultConfig: false,
* dataSourceUid: "grafanacloud-profiles",
* matches: [
* {
* property: "asserts_entity_type",
* op: "=",
* values: ["Service"],
* },
* {
* property: "deployment_environment",
* op: "=",
* values: [
* "production",
* "staging",
* ],
* },
* {
* property: "asserts_site",
* op: "=",
* values: [
* "us-east-1",
* "us-west-2",
* ],
* },
* ],
* entityPropertyToProfileLabelMapping: {
* cluster: "k8s_cluster_name",
* namespace: "k8s_namespace_name",
* container: "k8s_container_name",
* otel_service: "service_name",
* otel_namespace: "service_namespace",
* },
* });
* const development = new grafana.assert.ProfileConfig("development", {
* name: "development",
* priority: 2000,
* defaultConfig: false,
* dataSourceUid: "grafanacloud-profiles",
* matches: [
* {
* property: "asserts_entity_type",
* op: "=",
* values: ["Service"],
* },
* {
* property: "deployment_environment",
* op: "=",
* values: [
* "development",
* "testing",
* ],
* },
* {
* property: "asserts_site",
* op: "=",
* values: ["us-east-1"],
* },
* {
* property: "service",
* op: "=",
* values: ["my sample api"],
* },
* ],
* entityPropertyToProfileLabelMapping: {
* cluster: "k8s_cluster_name",
* namespace: "k8s_namespace_name",
* container: "k8s_container_name",
* otel_service: "service_name",
* otel_namespace: "service_namespace",
* pod: "k8s_pod_name",
* },
* });
* const minimal = new grafana.assert.ProfileConfig("minimal", {
* name: "minimal",
* priority: 3000,
* dataSourceUid: "pyroscope-minimal",
* matches: [{
* property: "asserts_entity_type",
* op: "IS NOT NULL",
* }],
* entityPropertyToProfileLabelMapping: {
* cluster: "k8s_cluster_name",
* otel_service: "service_name",
* otel_namespace: "service_namespace",
* },
* });
* ```
*
* ## Import
*
* ```sh
* terraform import grafana_asserts_profile_config.name "{{ name }}"
* ```
*/
class ProfileConfig extends pulumi.CustomResource {
/**
* Get an existing ProfileConfig 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 ProfileConfig(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of ProfileConfig. 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'] === ProfileConfig.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["dataSourceUid"] = state?.dataSourceUid;
resourceInputs["defaultConfig"] = state?.defaultConfig;
resourceInputs["entityPropertyToProfileLabelMapping"] = state?.entityPropertyToProfileLabelMapping;
resourceInputs["matches"] = state?.matches;
resourceInputs["name"] = state?.name;
resourceInputs["priority"] = state?.priority;
}
else {
const args = argsOrState;
if (args?.dataSourceUid === undefined && !opts.urn) {
throw new Error("Missing required property 'dataSourceUid'");
}
if (args?.defaultConfig === undefined && !opts.urn) {
throw new Error("Missing required property 'defaultConfig'");
}
if (args?.priority === undefined && !opts.urn) {
throw new Error("Missing required property 'priority'");
}
resourceInputs["dataSourceUid"] = args?.dataSourceUid;
resourceInputs["defaultConfig"] = args?.defaultConfig;
resourceInputs["entityPropertyToProfileLabelMapping"] = args?.entityPropertyToProfileLabelMapping;
resourceInputs["matches"] = args?.matches;
resourceInputs["name"] = args?.name;
resourceInputs["priority"] = args?.priority;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ProfileConfig.__pulumiType, name, resourceInputs, opts);
}
}
exports.ProfileConfig = ProfileConfig;
/** @internal */
ProfileConfig.__pulumiType = 'grafana:assert/profileConfig:ProfileConfig';
//# sourceMappingURL=profileConfig.js.map