@pulumiverse/grafana
Version:
A Pulumi package for creating and managing grafana.
223 lines (222 loc) • 7.11 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* 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 }}"
* ```
*/
export declare 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: string, id: pulumi.Input<pulumi.ID>, state?: ProfileConfigState, opts?: pulumi.CustomResourceOptions): ProfileConfig;
/**
* 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: any): obj is ProfileConfig;
/**
* DataSource to be queried (e.g., a Pyroscope instance).
*/
readonly dataSourceUid: pulumi.Output<string>;
/**
* Is it the default config, therefore undeletable?
*/
readonly defaultConfig: pulumi.Output<boolean>;
/**
* Mapping of entity properties to profile labels.
*/
readonly entityPropertyToProfileLabelMapping: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* List of match rules for entity properties.
*/
readonly matches: pulumi.Output<outputs.assert.ProfileConfigMatch[] | undefined>;
/**
* The name of the profile configuration.
*/
readonly name: pulumi.Output<string>;
/**
* Priority of the profile configuration. A lower number means a higher priority.
*/
readonly priority: pulumi.Output<number>;
/**
* Create a ProfileConfig resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: ProfileConfigArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering ProfileConfig resources.
*/
export interface ProfileConfigState {
/**
* DataSource to be queried (e.g., a Pyroscope instance).
*/
dataSourceUid?: pulumi.Input<string>;
/**
* Is it the default config, therefore undeletable?
*/
defaultConfig?: pulumi.Input<boolean>;
/**
* Mapping of entity properties to profile labels.
*/
entityPropertyToProfileLabelMapping?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* List of match rules for entity properties.
*/
matches?: pulumi.Input<pulumi.Input<inputs.assert.ProfileConfigMatch>[]>;
/**
* The name of the profile configuration.
*/
name?: pulumi.Input<string>;
/**
* Priority of the profile configuration. A lower number means a higher priority.
*/
priority?: pulumi.Input<number>;
}
/**
* The set of arguments for constructing a ProfileConfig resource.
*/
export interface ProfileConfigArgs {
/**
* DataSource to be queried (e.g., a Pyroscope instance).
*/
dataSourceUid: pulumi.Input<string>;
/**
* Is it the default config, therefore undeletable?
*/
defaultConfig: pulumi.Input<boolean>;
/**
* Mapping of entity properties to profile labels.
*/
entityPropertyToProfileLabelMapping?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* List of match rules for entity properties.
*/
matches?: pulumi.Input<pulumi.Input<inputs.assert.ProfileConfigMatch>[]>;
/**
* The name of the profile configuration.
*/
name?: pulumi.Input<string>;
/**
* Priority of the profile configuration. A lower number means a higher priority.
*/
priority: pulumi.Input<number>;
}