@pulumi/wavefront
Version:
A Pulumi package for creating and managing wavefront cloud resources.
104 lines • 4.23 kB
JavaScript
;
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.MetricsPolicy = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Provides a Wavefront Metrics Policy Resource. This allows management of Metrics Policy to control access to time series, histograms, and delta counters
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as wavefront from "@pulumi/wavefront";
*
* const everyone = wavefront.getDefaultUserGroup({});
* const main = new wavefront.MetricsPolicy("main", {policyRules: [{
* name: "Allow All Metrics",
* description: "Predefined policy rule. Allows access to all metrics (timeseries, histograms, and counters) for all accounts. If this rule is removed, all accounts can access all metrics if there are no matching blocking rules.",
* prefixes: ["*"],
* tagsAnded: false,
* accessType: "ALLOW",
* userGroupIds: [everyone.then(everyone => everyone.groupId)],
* }]});
* ```
*
* ## Data Source
*
* Provides a Wavefront Metrics Policy Data Source. This allows looking up the current policy and associated rules.
*
* ### Example
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as wavefront from "@pulumi/wavefront";
*
* export = async () => {
* const policy = await wavefront.getMetricsPolicy({});
* return {
* policy: policy,
* };
* }
* ```
*
* ## Import
*
* Users can be imported by using the `updated_epoch_millis`, e.g.:
*
* ```sh
* $ pulumi import wavefront:index/metricsPolicy:MetricsPolicy some_metrics_policy 1651846476678
* ```
*/
class MetricsPolicy extends pulumi.CustomResource {
/**
* Get an existing MetricsPolicy 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 MetricsPolicy(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of MetricsPolicy. 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'] === MetricsPolicy.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["customer"] = state ? state.customer : undefined;
resourceInputs["policyRules"] = state ? state.policyRules : undefined;
resourceInputs["updatedEpochMillis"] = state ? state.updatedEpochMillis : undefined;
resourceInputs["updaterId"] = state ? state.updaterId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.policyRules === undefined) && !opts.urn) {
throw new Error("Missing required property 'policyRules'");
}
resourceInputs["policyRules"] = args ? args.policyRules : undefined;
resourceInputs["customer"] = undefined /*out*/;
resourceInputs["updatedEpochMillis"] = undefined /*out*/;
resourceInputs["updaterId"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(MetricsPolicy.__pulumiType, name, resourceInputs, opts);
}
}
exports.MetricsPolicy = MetricsPolicy;
/** @internal */
MetricsPolicy.__pulumiType = 'wavefront:index/metricsPolicy:MetricsPolicy';
//# sourceMappingURL=metricsPolicy.js.map