@pulumi/sumologic
Version:
A Pulumi package for creating and managing sumologic cloud resources.
134 lines • 5.83 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.ScanBudget = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Provides a [Sumologic Scan Budget](https://help.sumologic.com/docs/manage/manage-subscription/usage-management/).
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as sumologic from "@pulumi/sumologic";
*
* const budget = new sumologic.ScanBudget("budget", {
* name: "TestBudget",
* capacity: 10,
* unit: "GB",
* budgetType: "ScanBudget",
* window: "Query",
* applicableOn: "PerEntity",
* groupBy: "User",
* action: "StopScan",
* status: "active",
* scope: {
* includedUsers: ["000000000000011C"],
* excludedUsers: [],
* includedRoles: [],
* excludedRoles: ["0000000000000196"],
* },
* });
* ```
*
* ## Import
*
* Scan budgets can be imported using the budget ID, e.g.:
*
* hcl
*
* ```sh
* $ pulumi import sumologic:index/scanBudget:ScanBudget budget 00000000000123AB
* ```
*
* [1]: https://help.sumologic.com/docs/manage/manage-subscription/usage-management/
*/
class ScanBudget extends pulumi.CustomResource {
/**
* Get an existing ScanBudget 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 ScanBudget(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of ScanBudget. 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'] === ScanBudget.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["action"] = state ? state.action : undefined;
resourceInputs["applicableOn"] = state ? state.applicableOn : undefined;
resourceInputs["budgetType"] = state ? state.budgetType : undefined;
resourceInputs["capacity"] = state ? state.capacity : undefined;
resourceInputs["groupBy"] = state ? state.groupBy : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["scope"] = state ? state.scope : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["unit"] = state ? state.unit : undefined;
resourceInputs["window"] = state ? state.window : undefined;
}
else {
const args = argsOrState;
if ((!args || args.action === undefined) && !opts.urn) {
throw new Error("Missing required property 'action'");
}
if ((!args || args.applicableOn === undefined) && !opts.urn) {
throw new Error("Missing required property 'applicableOn'");
}
if ((!args || args.budgetType === undefined) && !opts.urn) {
throw new Error("Missing required property 'budgetType'");
}
if ((!args || args.capacity === undefined) && !opts.urn) {
throw new Error("Missing required property 'capacity'");
}
if ((!args || args.groupBy === undefined) && !opts.urn) {
throw new Error("Missing required property 'groupBy'");
}
if ((!args || args.scope === undefined) && !opts.urn) {
throw new Error("Missing required property 'scope'");
}
if ((!args || args.status === undefined) && !opts.urn) {
throw new Error("Missing required property 'status'");
}
if ((!args || args.unit === undefined) && !opts.urn) {
throw new Error("Missing required property 'unit'");
}
if ((!args || args.window === undefined) && !opts.urn) {
throw new Error("Missing required property 'window'");
}
resourceInputs["action"] = args ? args.action : undefined;
resourceInputs["applicableOn"] = args ? args.applicableOn : undefined;
resourceInputs["budgetType"] = args ? args.budgetType : undefined;
resourceInputs["capacity"] = args ? args.capacity : undefined;
resourceInputs["groupBy"] = args ? args.groupBy : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["scope"] = args ? args.scope : undefined;
resourceInputs["status"] = args ? args.status : undefined;
resourceInputs["unit"] = args ? args.unit : undefined;
resourceInputs["window"] = args ? args.window : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ScanBudget.__pulumiType, name, resourceInputs, opts);
}
}
exports.ScanBudget = ScanBudget;
/** @internal */
ScanBudget.__pulumiType = 'sumologic:index/scanBudget:ScanBudget';
//# sourceMappingURL=scanBudget.js.map