UNPKG

@pulumi/harness

Version:

A Pulumi package for creating and managing Harness resources.

167 lines 6.04 kB
"use strict"; // *** 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.SecurityGovernanceRule = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Resource for managing a Harness Chaos Security Governance Rule * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as harness from "@pulumi/harness"; * * // K8s Rule * const example = new harness.chaos.SecurityGovernanceRule("example", { * orgId: "<org_id>", * projectId: "<project_id>", * name: "<name>", * description: "<description>", * isEnabled: true, * conditionIds: ["<condition_id>"], * userGroupIds: ["_project_all_users"], * tags: [ * "<tag1>", * "<tag2>", * ], * timeWindows: [{ * timeZone: "UTC", * startTime: 1711238400000, * duration: "24h", * recurrence: { * type: "Daily", * until: -1, * }, * }], * }); * // Linux Rule * const linuxRule = new harness.chaos.SecurityGovernanceRule("linux_rule", { * orgId: "<org_id>", * projectId: "<project_id>", * name: "<name>", * description: "<description>", * isEnabled: true, * conditionIds: ["<condition_id>"], * userGroupIds: ["_project_all_users"], * tags: [ * "<tag1>", * "<tag2>", * ], * timeWindows: [{ * timeZone: "UTC", * startTime: 1711238400000, * duration: "24h", * recurrence: { * type: "Daily", * until: -1, * }, * }], * }); * // Windows Rule * const windowsRule = new harness.chaos.SecurityGovernanceRule("windows_rule", { * orgId: "<org_id>", * projectId: "<project_id>", * name: "<name>", * description: "<description>", * isEnabled: true, * conditionIds: ["<condition_id>"], * userGroupIds: ["_project_all_users"], * tags: [ * "<tag1>", * "<tag2>", * ], * timeWindows: [{ * timeZone: "UTC", * startTime: 1711238400000, * duration: "24h", * recurrence: { * type: "Daily", * until: -1, * }, * }], * }); * ``` * * ## Import * * The `pulumi import` command can be used, for example: * * Import Project level Chaos Security Governance Rule * * ```sh * $ pulumi import harness:chaos/securityGovernanceRule:SecurityGovernanceRule example org_id/project_id/rule_id * ``` */ class SecurityGovernanceRule extends pulumi.CustomResource { /** * Get an existing SecurityGovernanceRule 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 SecurityGovernanceRule(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of SecurityGovernanceRule. 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'] === SecurityGovernanceRule.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["conditionIds"] = state?.conditionIds; resourceInputs["description"] = state?.description; resourceInputs["isEnabled"] = state?.isEnabled; resourceInputs["name"] = state?.name; resourceInputs["orgId"] = state?.orgId; resourceInputs["projectId"] = state?.projectId; resourceInputs["tags"] = state?.tags; resourceInputs["timeWindows"] = state?.timeWindows; resourceInputs["userGroupIds"] = state?.userGroupIds; } else { const args = argsOrState; if (args?.conditionIds === undefined && !opts.urn) { throw new Error("Missing required property 'conditionIds'"); } if (args?.orgId === undefined && !opts.urn) { throw new Error("Missing required property 'orgId'"); } if (args?.projectId === undefined && !opts.urn) { throw new Error("Missing required property 'projectId'"); } if (args?.timeWindows === undefined && !opts.urn) { throw new Error("Missing required property 'timeWindows'"); } resourceInputs["conditionIds"] = args?.conditionIds; resourceInputs["description"] = args?.description; resourceInputs["isEnabled"] = args?.isEnabled; resourceInputs["name"] = args?.name; resourceInputs["orgId"] = args?.orgId; resourceInputs["projectId"] = args?.projectId; resourceInputs["tags"] = args?.tags; resourceInputs["timeWindows"] = args?.timeWindows; resourceInputs["userGroupIds"] = args?.userGroupIds; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(SecurityGovernanceRule.__pulumiType, name, resourceInputs, opts); } } exports.SecurityGovernanceRule = SecurityGovernanceRule; /** @internal */ SecurityGovernanceRule.__pulumiType = 'harness:chaos/securityGovernanceRule:SecurityGovernanceRule'; //# sourceMappingURL=securityGovernanceRule.js.map