@pulumiverse/grafana
Version:
A Pulumi package for creating and managing grafana.
567 lines (566 loc) • 21.4 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* Synthetic Monitoring checks are tests that run on selected probes at defined
* intervals and report metrics and logs back to your Grafana Cloud account. The
* target for checks can be a domain name, a server, or a website, depending on
* what information you would like to gather about your endpoint. You can define
* multiple checks for a single endpoint to check different capabilities.
*
* * [Official documentation](https://grafana.com/docs/grafana-cloud/testing/synthetic-monitoring/create-checks/checks/)
*
* ## Example Usage
*
* ### DNS Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as grafana from "@pulumi/grafana";
* import * as grafana from "@pulumiverse/grafana";
*
* const main = grafana.syntheticMonitoring.getProbes({});
* const dns = new grafana.syntheticmonitoring.Check("dns", {
* job: "DNS Defaults",
* target: "grafana.com",
* enabled: false,
* probes: [main.then(main => main.probes?.ohio)],
* labels: {
* foo: "bar",
* },
* settings: {
* dns: {},
* },
* });
* ```
*
* ### DNS Complex
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as grafana from "@pulumi/grafana";
* import * as grafana from "@pulumiverse/grafana";
*
* const main = grafana.syntheticMonitoring.getProbes({});
* const dns = new grafana.syntheticmonitoring.Check("dns", {
* job: "DNS Updated",
* target: "grafana.net",
* enabled: false,
* probes: [
* main.then(main => main.probes?.frankfurt),
* main.then(main => main.probes?.london),
* ],
* labels: {
* foo: "baz",
* },
* settings: {
* dns: {
* ipVersion: "Any",
* server: "8.8.4.4",
* port: 8600,
* recordType: "CNAME",
* protocol: "TCP",
* validRCodes: [
* "NOERROR",
* "NOTAUTH",
* ],
* validateAnswerRrs: {
* failIfMatchesRegexps: [".+-bad-stuff*"],
* failIfNotMatchesRegexps: [".+-good-stuff*"],
* },
* validateAuthorityRrs: {
* failIfMatchesRegexps: [".+-bad-stuff*"],
* failIfNotMatchesRegexps: [".+-good-stuff*"],
* },
* validateAdditionalRrs: [{
* failIfMatchesRegexps: [".+-bad-stuff*"],
* failIfNotMatchesRegexps: [".+-good-stuff*"],
* }],
* },
* },
* });
* ```
*
* ### HTTP Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as grafana from "@pulumi/grafana";
* import * as grafana from "@pulumiverse/grafana";
*
* const main = grafana.syntheticMonitoring.getProbes({});
* const http = new grafana.syntheticmonitoring.Check("http", {
* job: "HTTP Defaults",
* target: "https://grafana.com",
* enabled: false,
* probes: [main.then(main => main.probes?.ohio)],
* labels: {
* foo: "bar",
* },
* settings: {
* http: {},
* },
* });
* ```
*
* ### HTTP Complex
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as grafana from "@pulumi/grafana";
* import * as grafana from "@pulumiverse/grafana";
*
* const main = grafana.syntheticMonitoring.getProbes({});
* const http = new grafana.syntheticmonitoring.Check("http", {
* job: "HTTP Defaults",
* target: "https://grafana.org",
* enabled: false,
* probes: [
* main.then(main => main.probes?.mumbai),
* main.then(main => main.probes?.mumbai),
* ],
* labels: {
* foo: "bar",
* },
* settings: {
* http: {
* ipVersion: "V6",
* method: "TRACE",
* body: "and spirit",
* noFollowRedirects: true,
* bearerToken: "asdfjkl;",
* proxyUrl: "https://almost-there",
* failIfSsl: true,
* failIfNotSsl: true,
* compression: "deflate",
* cacheBustingQueryParamName: "pineapple",
* tlsConfig: {
* serverName: "grafana.org",
* clientCert: `-----BEGIN CERTIFICATE-----
* MIIEljCCAn4CCQCKJPUQQxeO0zANBgkqhkiG9w0BAQsFADANMQswCQYDVQQGEwJT
* RTAeFw0yMTA1MjkxOTIyNTdaFw0yNDAzMTgxOTIyNTdaMA0xCzAJBgNVBAYTAlNF
* MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAnmbazDNUT0rSI4BpGZK+
* 0AJ+9FDkIYWJUtRLJoxw8CF+AobMFploYA2L2Myt80cTA1w8FrewjC8qlqdnrPWr
* h1ely2zsUljgi1/niH0ndjFzliL7UkinXQ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JB7UKD9
* 5TA+B4EBzQ1tMbGFU1DX79MjAejq0IV0Nzq+GMfBvLHxEf4+Oz8nqhDXQcJ6TdtY
* l3Lyw5zBvOL80SBK+Mr0UP7d9U3VXgbGHCYVJU6Ot1TwiGwahtWALRALA3TWeGkq
* 7kyD1H+nm+9lfKhuyBRQnRGBVyze2lAp7oxwshJuhBwEXosXFxq1Cy6QhPN77r6N
* vuhxvtppolNnyOgGxwG4zquqq2V5/+vKjKY=
* -----END CERTIFICATE-----
* `,
* },
* headers: ["Content-Type: multipart/form-data; boundary=something"],
* basicAuth: {
* username: "open",
* password: "sesame",
* },
* validStatusCodes: [
* 200,
* 201,
* ],
* validHttpVersions: [
* "HTTP/1.0",
* "HTTP/1.1",
* "HTTP/2.0",
* ],
* failIfBodyMatchesRegexps: [".*bad stuff.*"],
* failIfBodyNotMatchesRegexps: [".*good stuff.*"],
* failIfHeaderMatchesRegexps: [{
* header: "Content-Type",
* regexp: "application/soap*",
* allowMissing: true,
* }],
* },
* },
* });
* ```
*
* ### Ping Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as grafana from "@pulumi/grafana";
* import * as grafana from "@pulumiverse/grafana";
*
* const main = grafana.syntheticMonitoring.getProbes({});
* const ping = new grafana.syntheticmonitoring.Check("ping", {
* job: "Ping Defaults",
* target: "grafana.com",
* enabled: false,
* probes: [main.then(main => main.probes?.ohio)],
* labels: {
* foo: "bar",
* },
* settings: {
* ping: {},
* },
* });
* ```
*
* ### Ping Complex
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as grafana from "@pulumi/grafana";
* import * as grafana from "@pulumiverse/grafana";
*
* const main = grafana.syntheticMonitoring.getProbes({});
* const ping = new grafana.syntheticmonitoring.Check("ping", {
* job: "Ping Updated",
* target: "grafana.net",
* enabled: false,
* probes: [
* main.then(main => main.probes?.frankfurt),
* main.then(main => main.probes?.london),
* ],
* labels: {
* foo: "baz",
* },
* settings: {
* ping: {
* ipVersion: "Any",
* payloadSize: 20,
* dontFragment: true,
* },
* },
* });
* ```
*
* ### TCP Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as grafana from "@pulumi/grafana";
* import * as grafana from "@pulumiverse/grafana";
*
* const main = grafana.syntheticMonitoring.getProbes({});
* const tcp = new grafana.syntheticmonitoring.Check("tcp", {
* job: "TCP Defaults",
* target: "grafana.com:80",
* enabled: false,
* probes: [main.then(main => main.probes?.ohio)],
* labels: {
* foo: "bar",
* },
* settings: {
* tcp: {},
* },
* });
* ```
*
* ### TCP Complex
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as grafana from "@pulumi/grafana";
* import * as grafana from "@pulumiverse/grafana";
*
* const main = grafana.syntheticMonitoring.getProbes({});
* const tcp = new grafana.syntheticmonitoring.Check("tcp", {
* job: "TCP Defaults",
* target: "grafana.com:443",
* enabled: false,
* probes: [
* main.then(main => main.probes?.frankfurt),
* main.then(main => main.probes?.london),
* ],
* labels: {
* foo: "baz",
* },
* settings: {
* tcp: {
* ipVersion: "V6",
* tls: true,
* queryResponses: [
* {
* send: "howdy",
* expect: "hi",
* },
* {
* send: "like this",
* expect: "like that",
* startTls: true,
* },
* ],
* tlsConfig: {
* serverName: "grafana.com",
* caCert: `-----BEGIN CERTIFICATE-----
* MIIEljCCAn4CCQCKJPUQQxeO0zANBgkqhkiG9w0BAQsFADANMQswCQYDVQQGEwJT
* RTAeFw0yMTA1MjkxOTIyNTdaFw0yNDAzMTgxOTIyNTdaMA0xCzAJBgNVBAYTAlNF
* MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAnmbazDNUT0rSI4BpGZK+
* 0AJ+9FDkIYWJUtRLJoxw8CF+AobMFploYA2L2Myt80cTA1w8FrewjC8qlqdnrPWr
* h1ely2zsUljgi1/niH0ndjFzliL7UkinXQiAsTtYOrOQmzyd/o5PNdu7dz0m7stD
* BN/Sz5TlXZnA1/eJbqV/kqMau6b1MaBx8SbRfUG9+cSmUobFJwuktDr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5zBvOL80SBK+Mr0UP7d9U3VXgbGHCYVJU6Ot1TwiGwahtWALRALA3TWeGkq
* 7kyD1H+nm+9lfKhuyBRQnRGBVyze2lAp7oxwshJuhBwEXosXFxq1Cy6QhPN77r6N
* vuhxvtppolNnyOgGxwG4zquqq2V5/+vKjKY=
* -----END CERTIFICATE-----
* `,
* },
* },
* },
* });
* ```
*
* ### Traceroute Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as grafana from "@pulumi/grafana";
* import * as grafana from "@pulumiverse/grafana";
*
* const main = grafana.syntheticMonitoring.getProbes({});
* const traceroute = new grafana.syntheticmonitoring.Check("traceroute", {
* job: "Traceroute defaults",
* target: "grafana.com",
* enabled: false,
* frequency: 120000,
* timeout: 30000,
* probes: [main.then(main => main.probes?.ohio)],
* labels: {
* foo: "bar",
* },
* settings: {
* traceroute: {},
* },
* });
* ```
*
* ### Traceroute Complex
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as grafana from "@pulumi/grafana";
* import * as grafana from "@pulumiverse/grafana";
*
* const main = grafana.syntheticMonitoring.getProbes({});
* const traceroute = new grafana.syntheticmonitoring.Check("traceroute", {
* job: "Traceroute complex",
* target: "grafana.net",
* enabled: false,
* frequency: 120000,
* timeout: 30000,
* probes: [
* main.then(main => main.probes?.frankfurt),
* main.then(main => main.probes?.london),
* ],
* labels: {
* foo: "baz",
* },
* settings: {
* traceroute: {
* maxHops: 25,
* maxUnknownHops: 10,
* ptrLookup: false,
* },
* },
* });
* ```
*
* ## Import
*
* ```sh
* $ pulumi import grafana:syntheticMonitoring/check:Check name "{{ id }}"
* ```
*/
export declare class Check extends pulumi.CustomResource {
/**
* Get an existing Check 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?: CheckState, opts?: pulumi.CustomResourceOptions): Check;
/**
* Returns true if the given object is an instance of Check. 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 Check;
/**
* Can be set to `none`, `low`, `medium`, or `high` to correspond to the check [alert levels](https://grafana.com/docs/grafana-cloud/testing/synthetic-monitoring/configure-alerts/synthetic-monitoring-alerting/). Defaults to `none`.
*/
readonly alertSensitivity: pulumi.Output<string | undefined>;
/**
* Metrics are reduced by default. Set this to `false` if you'd like to publish all metrics. We maintain a [full list of metrics](https://github.com/grafana/synthetic-monitoring-agent/tree/main/internal/scraper/testdata) collected for each. Defaults to `true`.
*/
readonly basicMetricsOnly: pulumi.Output<boolean | undefined>;
/**
* Whether to enable the check. Defaults to `true`.
*/
readonly enabled: pulumi.Output<boolean | undefined>;
/**
* How often the check runs in milliseconds (the value is not truly a "frequency" but a "period"). The minimum acceptable value is 1 second (1000 ms), and the maximum is 1 hour (3600000 ms). Defaults to `60000`.
*/
readonly frequency: pulumi.Output<number | undefined>;
/**
* Name used for job label.
*/
readonly job: pulumi.Output<string>;
/**
* Custom labels to be included with collected metrics and logs. The maximum number of labels that can be specified per check is 5. These are applied, along with the probe-specific labels, to the outgoing metrics. The names and values of the labels cannot be empty, and the maximum length is 32 bytes.
*/
readonly labels: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* List of probe location IDs where this target will be checked from.
*/
readonly probes: pulumi.Output<number[]>;
/**
* Check settings. Should contain exactly one nested block.
*/
readonly settings: pulumi.Output<outputs.syntheticMonitoring.CheckSettings>;
/**
* Hostname to ping.
*/
readonly target: pulumi.Output<string>;
/**
* The tenant ID of the check.
*/
readonly tenantId: pulumi.Output<number>;
/**
* Specifies the maximum running time for the check in milliseconds. The minimum acceptable value is 1 second (1000 ms), and the maximum 10 seconds (10000 ms). Defaults to `3000`.
*/
readonly timeout: pulumi.Output<number | undefined>;
/**
* Create a Check 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: CheckArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Check resources.
*/
export interface CheckState {
/**
* Can be set to `none`, `low`, `medium`, or `high` to correspond to the check [alert levels](https://grafana.com/docs/grafana-cloud/testing/synthetic-monitoring/configure-alerts/synthetic-monitoring-alerting/). Defaults to `none`.
*/
alertSensitivity?: pulumi.Input<string>;
/**
* Metrics are reduced by default. Set this to `false` if you'd like to publish all metrics. We maintain a [full list of metrics](https://github.com/grafana/synthetic-monitoring-agent/tree/main/internal/scraper/testdata) collected for each. Defaults to `true`.
*/
basicMetricsOnly?: pulumi.Input<boolean>;
/**
* Whether to enable the check. Defaults to `true`.
*/
enabled?: pulumi.Input<boolean>;
/**
* How often the check runs in milliseconds (the value is not truly a "frequency" but a "period"). The minimum acceptable value is 1 second (1000 ms), and the maximum is 1 hour (3600000 ms). Defaults to `60000`.
*/
frequency?: pulumi.Input<number>;
/**
* Name used for job label.
*/
job?: pulumi.Input<string>;
/**
* Custom labels to be included with collected metrics and logs. The maximum number of labels that can be specified per check is 5. These are applied, along with the probe-specific labels, to the outgoing metrics. The names and values of the labels cannot be empty, and the maximum length is 32 bytes.
*/
labels?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* List of probe location IDs where this target will be checked from.
*/
probes?: pulumi.Input<pulumi.Input<number>[]>;
/**
* Check settings. Should contain exactly one nested block.
*/
settings?: pulumi.Input<inputs.syntheticMonitoring.CheckSettings>;
/**
* Hostname to ping.
*/
target?: pulumi.Input<string>;
/**
* The tenant ID of the check.
*/
tenantId?: pulumi.Input<number>;
/**
* Specifies the maximum running time for the check in milliseconds. The minimum acceptable value is 1 second (1000 ms), and the maximum 10 seconds (10000 ms). Defaults to `3000`.
*/
timeout?: pulumi.Input<number>;
}
/**
* The set of arguments for constructing a Check resource.
*/
export interface CheckArgs {
/**
* Can be set to `none`, `low`, `medium`, or `high` to correspond to the check [alert levels](https://grafana.com/docs/grafana-cloud/testing/synthetic-monitoring/configure-alerts/synthetic-monitoring-alerting/). Defaults to `none`.
*/
alertSensitivity?: pulumi.Input<string>;
/**
* Metrics are reduced by default. Set this to `false` if you'd like to publish all metrics. We maintain a [full list of metrics](https://github.com/grafana/synthetic-monitoring-agent/tree/main/internal/scraper/testdata) collected for each. Defaults to `true`.
*/
basicMetricsOnly?: pulumi.Input<boolean>;
/**
* Whether to enable the check. Defaults to `true`.
*/
enabled?: pulumi.Input<boolean>;
/**
* How often the check runs in milliseconds (the value is not truly a "frequency" but a "period"). The minimum acceptable value is 1 second (1000 ms), and the maximum is 1 hour (3600000 ms). Defaults to `60000`.
*/
frequency?: pulumi.Input<number>;
/**
* Name used for job label.
*/
job: pulumi.Input<string>;
/**
* Custom labels to be included with collected metrics and logs. The maximum number of labels that can be specified per check is 5. These are applied, along with the probe-specific labels, to the outgoing metrics. The names and values of the labels cannot be empty, and the maximum length is 32 bytes.
*/
labels?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* List of probe location IDs where this target will be checked from.
*/
probes: pulumi.Input<pulumi.Input<number>[]>;
/**
* Check settings. Should contain exactly one nested block.
*/
settings: pulumi.Input<inputs.syntheticMonitoring.CheckSettings>;
/**
* Hostname to ping.
*/
target: pulumi.Input<string>;
/**
* Specifies the maximum running time for the check in milliseconds. The minimum acceptable value is 1 second (1000 ms), and the maximum 10 seconds (10000 ms). Defaults to `3000`.
*/
timeout?: pulumi.Input<number>;
}