UNPKG

@pulumi/harness

Version:

A Pulumi package for creating and managing Harness resources.

120 lines 4.82 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.Hub = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Resource for managing a Harness Chaos Hub * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as harness from "@pulumi/harness"; * * const example = new harness.chaos.Hub("example", { * orgId: "<org_id>", * projectId: "<project_id>", * name: "<name>", * description: "<description>", * connectorId: "<connector_id>", * repoBranch: "<repo_branch>", * repoName: "<repo_name>", * isDefault: false, * tags: [ * "<tag1>", * "<tag2>", * ], * }); * ``` * * ## Import * * The `pulumi import` command can be used, for example: * * Import Project level Chaos Hub * * ```sh * $ pulumi import harness:chaos/hub:Hub example <org_id>/<project_id>/<hub_id> * ``` */ class Hub extends pulumi.CustomResource { /** * Get an existing Hub 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 Hub(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of Hub. 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'] === Hub.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["connectorId"] = state?.connectorId; resourceInputs["connectorScope"] = state?.connectorScope; resourceInputs["createdAt"] = state?.createdAt; resourceInputs["description"] = state?.description; resourceInputs["isAvailable"] = state?.isAvailable; resourceInputs["isDefault"] = state?.isDefault; resourceInputs["lastSyncedAt"] = state?.lastSyncedAt; resourceInputs["name"] = state?.name; resourceInputs["orgId"] = state?.orgId; resourceInputs["projectId"] = state?.projectId; resourceInputs["repoBranch"] = state?.repoBranch; resourceInputs["repoName"] = state?.repoName; resourceInputs["tags"] = state?.tags; resourceInputs["totalExperiments"] = state?.totalExperiments; resourceInputs["totalFaults"] = state?.totalFaults; resourceInputs["updatedAt"] = state?.updatedAt; } else { const args = argsOrState; if (args?.connectorId === undefined && !opts.urn) { throw new Error("Missing required property 'connectorId'"); } if (args?.repoBranch === undefined && !opts.urn) { throw new Error("Missing required property 'repoBranch'"); } resourceInputs["connectorId"] = args?.connectorId; resourceInputs["connectorScope"] = args?.connectorScope; resourceInputs["description"] = args?.description; resourceInputs["isDefault"] = args?.isDefault; resourceInputs["name"] = args?.name; resourceInputs["orgId"] = args?.orgId; resourceInputs["projectId"] = args?.projectId; resourceInputs["repoBranch"] = args?.repoBranch; resourceInputs["repoName"] = args?.repoName; resourceInputs["tags"] = args?.tags; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["isAvailable"] = undefined /*out*/; resourceInputs["lastSyncedAt"] = undefined /*out*/; resourceInputs["totalExperiments"] = undefined /*out*/; resourceInputs["totalFaults"] = undefined /*out*/; resourceInputs["updatedAt"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Hub.__pulumiType, name, resourceInputs, opts); } } exports.Hub = Hub; /** @internal */ Hub.__pulumiType = 'harness:chaos/hub:Hub'; //# sourceMappingURL=hub.js.map