UNPKG

@lbrlabs/pulumi-harness

Version:

A Pulumi package for creating and managing Harness resources.

150 lines 5.9 kB
"use strict"; // *** 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.InputSet = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Resource for creating a Harness InputSet. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as harness from "@lbrlabs/pulumi-harness"; * * const example = new harness.platform.InputSet("example", { * identifier: "identifier", * tags: ["foo:bar"], * orgId: "org_id", * projectId: "project_id", * pipelineId: "pipeline_id", * yaml: `inputSet: * identifier: "identifier" * name: "name" * tags: * foo: "bar" * orgIdentifier: "org_id" * projectIdentifier: "project_id" * pipeline: * identifier: "pipeline_id" * variables: * - name: "key" * type: "String" * value: "value" * `, * }); * // Remote InputSet * const test = new harness.platform.InputSet("test", { * identifier: "identifier", * tags: ["foo:bar"], * orgId: harness_platform_organization.test.id, * projectId: harness_platform_project.test.id, * pipelineId: harness_platform_pipeline.test.id, * gitDetails: { * branchName: "main", * commitMessage: "Commit", * filePath: ".harness/file_path.yaml", * connectorRef: "account.connector_ref", * storeType: "REMOTE", * repoName: "repo_name", * }, * yaml: `inputSet: * identifier: "identifier" * name: "name" * tags: * foo: "bar" * orgIdentifier: "${harness_platform_organization.test.id}" * projectIdentifier: "${harness_platform_project.test.id}" * pipeline: * identifier: "${harness_platform_pipeline.test.id}" * variables: * - name: "key" * type: "String" * value: "value" * `, * }); * ``` * * ## Import * * Import input set * * ```sh * $ pulumi import harness:platform/inputSet:InputSet example <org_id>/<project_id>/<pipeline_id>/<input_set_id> * ``` */ class InputSet extends pulumi.CustomResource { /** * Get an existing InputSet 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 InputSet(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of InputSet. 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'] === InputSet.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["gitDetails"] = state ? state.gitDetails : undefined; resourceInputs["identifier"] = state ? state.identifier : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["orgId"] = state ? state.orgId : undefined; resourceInputs["pipelineId"] = state ? state.pipelineId : undefined; resourceInputs["projectId"] = state ? state.projectId : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["yaml"] = state ? state.yaml : undefined; } else { const args = argsOrState; if ((!args || args.identifier === undefined) && !opts.urn) { throw new Error("Missing required property 'identifier'"); } if ((!args || args.orgId === undefined) && !opts.urn) { throw new Error("Missing required property 'orgId'"); } if ((!args || args.pipelineId === undefined) && !opts.urn) { throw new Error("Missing required property 'pipelineId'"); } if ((!args || args.projectId === undefined) && !opts.urn) { throw new Error("Missing required property 'projectId'"); } if ((!args || args.yaml === undefined) && !opts.urn) { throw new Error("Missing required property 'yaml'"); } resourceInputs["description"] = args ? args.description : undefined; resourceInputs["gitDetails"] = args ? args.gitDetails : undefined; resourceInputs["identifier"] = args ? args.identifier : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["orgId"] = args ? args.orgId : undefined; resourceInputs["pipelineId"] = args ? args.pipelineId : undefined; resourceInputs["projectId"] = args ? args.projectId : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["yaml"] = args ? args.yaml : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(InputSet.__pulumiType, name, resourceInputs, opts); } } exports.InputSet = InputSet; /** @internal */ InputSet.__pulumiType = 'harness:platform/inputSet:InputSet'; //# sourceMappingURL=inputSet.js.map