@pulumiverse/grafana
Version:
A Pulumi package for creating and managing grafana.
96 lines • 4.01 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.DataSourceCacheConfig = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages cache configuration for a data source (Grafana Enterprise).
*
* Use this resource to enable or disable caching for a particular data source. You can also tune the TTL settings for the cache behaviour, or choose to use defaults.
*
* Deleting this resource will cause the cache to be disabled for the target data source.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as grafana from "@pulumiverse/grafana";
*
* const loki = new grafana.oss.DataSource("loki", {
* type: "loki",
* name: "loki",
* url: "http://localhost:3100",
* });
* const lokiCache = new grafana.enterprise.DataSourceCacheConfig("loki_cache", {
* datasourceUid: loki.uid,
* enabled: true,
* useDefaultTtl: false,
* ttlQueriesMs: 60000,
* ttlResourcesMs: 300000,
* });
* ```
*
* ## Import
*
* ```sh
* terraform import grafana_data_source_cache_config.name "{{ datasource_uid }}"
* terraform import grafana_data_source_cache_config.name "{{ orgID }}:{{ datasource_uid }}"
* ```
*/
class DataSourceCacheConfig extends pulumi.CustomResource {
/**
* Get an existing DataSourceCacheConfig 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 DataSourceCacheConfig(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of DataSourceCacheConfig. 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'] === DataSourceCacheConfig.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["datasourceUid"] = state?.datasourceUid;
resourceInputs["enabled"] = state?.enabled;
resourceInputs["orgId"] = state?.orgId;
resourceInputs["ttlQueriesMs"] = state?.ttlQueriesMs;
resourceInputs["ttlResourcesMs"] = state?.ttlResourcesMs;
resourceInputs["useDefaultTtl"] = state?.useDefaultTtl;
}
else {
const args = argsOrState;
if (args?.datasourceUid === undefined && !opts.urn) {
throw new Error("Missing required property 'datasourceUid'");
}
resourceInputs["datasourceUid"] = args?.datasourceUid;
resourceInputs["enabled"] = args?.enabled;
resourceInputs["orgId"] = args?.orgId;
resourceInputs["ttlQueriesMs"] = args?.ttlQueriesMs;
resourceInputs["ttlResourcesMs"] = args?.ttlResourcesMs;
resourceInputs["useDefaultTtl"] = args?.useDefaultTtl;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(DataSourceCacheConfig.__pulumiType, name, resourceInputs, opts);
}
}
exports.DataSourceCacheConfig = DataSourceCacheConfig;
/** @internal */
DataSourceCacheConfig.__pulumiType = 'grafana:enterprise/dataSourceCacheConfig:DataSourceCacheConfig';
//# sourceMappingURL=dataSourceCacheConfig.js.map