@pulumi/harness
Version:
A Pulumi package for creating and managing Harness resources.
96 lines • 4.44 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.RuleEnforcement = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Resource for creating, updating, and managing rule enforcement.
*
* ## Import
*
* The `pulumi import` command can be used, for example:
*
* Import governance enforcement
*
* ```sh
* $ pulumi import harness:governance/ruleEnforcement:RuleEnforcement example <enforcement_id>
* ```
*/
class RuleEnforcement extends pulumi.CustomResource {
/**
* Get an existing RuleEnforcement 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 RuleEnforcement(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of RuleEnforcement. 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'] === RuleEnforcement.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["cloudProvider"] = state?.cloudProvider;
resourceInputs["description"] = state?.description;
resourceInputs["enforcementId"] = state?.enforcementId;
resourceInputs["executionSchedule"] = state?.executionSchedule;
resourceInputs["executionTimezone"] = state?.executionTimezone;
resourceInputs["isDryRun"] = state?.isDryRun;
resourceInputs["isEnabled"] = state?.isEnabled;
resourceInputs["name"] = state?.name;
resourceInputs["ruleIds"] = state?.ruleIds;
resourceInputs["ruleSetIds"] = state?.ruleSetIds;
resourceInputs["targetAccounts"] = state?.targetAccounts;
resourceInputs["targetRegions"] = state?.targetRegions;
}
else {
const args = argsOrState;
if (args?.cloudProvider === undefined && !opts.urn) {
throw new Error("Missing required property 'cloudProvider'");
}
if (args?.executionSchedule === undefined && !opts.urn) {
throw new Error("Missing required property 'executionSchedule'");
}
if (args?.executionTimezone === undefined && !opts.urn) {
throw new Error("Missing required property 'executionTimezone'");
}
if (args?.targetAccounts === undefined && !opts.urn) {
throw new Error("Missing required property 'targetAccounts'");
}
resourceInputs["cloudProvider"] = args?.cloudProvider;
resourceInputs["description"] = args?.description;
resourceInputs["executionSchedule"] = args?.executionSchedule;
resourceInputs["executionTimezone"] = args?.executionTimezone;
resourceInputs["isDryRun"] = args?.isDryRun;
resourceInputs["isEnabled"] = args?.isEnabled;
resourceInputs["name"] = args?.name;
resourceInputs["ruleIds"] = args?.ruleIds;
resourceInputs["ruleSetIds"] = args?.ruleSetIds;
resourceInputs["targetAccounts"] = args?.targetAccounts;
resourceInputs["targetRegions"] = args?.targetRegions;
resourceInputs["enforcementId"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(RuleEnforcement.__pulumiType, name, resourceInputs, opts);
}
}
exports.RuleEnforcement = RuleEnforcement;
/** @internal */
RuleEnforcement.__pulumiType = 'harness:governance/ruleEnforcement:RuleEnforcement';
//# sourceMappingURL=ruleEnforcement.js.map