@pulumi/sumologic
Version:
A Pulumi package for creating and managing sumologic cloud resources.
120 lines • 5.18 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.IngestBudgetV2 = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Provides a [Sumologic Ingest Budget v2][1].
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as sumologic from "@pulumi/sumologic";
*
* const budget = new sumologic.IngestBudgetV2("budget", {
* name: "testBudget",
* scope: "_sourceCategory=*prod*nginx*",
* budgetType: "dailyVolume",
* capacityBytes: 30000000000,
* description: "For testing purposes",
* timezone: "Etc/UTC",
* action: "keepCollecting",
* resetTime: "00:00",
* auditThreshold: 85,
* });
* ```
*
* ## Import
*
* Ingest budgets can be imported using the budget ID or name, e.g.:
*
* hcl
*
* ```sh
* $ pulumi import sumologic:index/ingestBudgetV2:IngestBudgetV2 budget 00000000000123AB
* ```
*
* ```sh
* $ pulumi import sumologic:index/ingestBudgetV2:IngestBudgetV2 dev_budget "DevelopersBudget"
* ```
*
* [1]: https://help.sumologic.com/Beta/Metadata_Ingest_Budgets
*
* [2]: https://en.wikipedia.org/wiki/Tz_database
*/
class IngestBudgetV2 extends pulumi.CustomResource {
/**
* Get an existing IngestBudgetV2 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 IngestBudgetV2(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of IngestBudgetV2. 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'] === IngestBudgetV2.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["action"] = state ? state.action : undefined;
resourceInputs["auditThreshold"] = state ? state.auditThreshold : undefined;
resourceInputs["budgetType"] = state ? state.budgetType : undefined;
resourceInputs["capacityBytes"] = state ? state.capacityBytes : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["resetTime"] = state ? state.resetTime : undefined;
resourceInputs["scope"] = state ? state.scope : undefined;
resourceInputs["timezone"] = state ? state.timezone : undefined;
}
else {
const args = argsOrState;
if ((!args || args.action === undefined) && !opts.urn) {
throw new Error("Missing required property 'action'");
}
if ((!args || args.capacityBytes === undefined) && !opts.urn) {
throw new Error("Missing required property 'capacityBytes'");
}
if ((!args || args.resetTime === undefined) && !opts.urn) {
throw new Error("Missing required property 'resetTime'");
}
if ((!args || args.scope === undefined) && !opts.urn) {
throw new Error("Missing required property 'scope'");
}
if ((!args || args.timezone === undefined) && !opts.urn) {
throw new Error("Missing required property 'timezone'");
}
resourceInputs["action"] = args ? args.action : undefined;
resourceInputs["auditThreshold"] = args ? args.auditThreshold : undefined;
resourceInputs["budgetType"] = args ? args.budgetType : undefined;
resourceInputs["capacityBytes"] = args ? args.capacityBytes : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["resetTime"] = args ? args.resetTime : undefined;
resourceInputs["scope"] = args ? args.scope : undefined;
resourceInputs["timezone"] = args ? args.timezone : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(IngestBudgetV2.__pulumiType, name, resourceInputs, opts);
}
}
exports.IngestBudgetV2 = IngestBudgetV2;
/** @internal */
IngestBudgetV2.__pulumiType = 'sumologic:index/ingestBudgetV2:IngestBudgetV2';
//# sourceMappingURL=ingestBudgetV2.js.map