UNPKG

@lbrlabs/pulumi-harness

Version:

A Pulumi package for creating and managing Harness resources.

107 lines 4.49 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.GitOpsRepoCred = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Resource for creating a Harness Gitops Repositories Credentials. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as harness from "@lbrlabs/pulumi-harness"; * * const test = new harness.platform.GitOpsRepoCred("test", { * identifier: "identifier", * accountId: "account_id", * agentId: "agent_id", * projectId: "project_id", * orgId: "org_id", * creds: [{ * type: "git", * url: "github.com", * sshPrivateKey: "yoursshprivatekey", * }], * }); * ``` * * ## Import * * Import a Account level Gitops Repository Credentials * * ```sh * $ pulumi import harness:platform/gitOpsRepoCred:GitOpsRepoCred example <agent_id>/<repocred_id> * ``` * * Import a Project level Gitops Repository Credentials * * ```sh * $ pulumi import harness:platform/gitOpsRepoCred:GitOpsRepoCred example <organization_id>/<project_id>/<agent_id>/<repocred_id> * ``` */ class GitOpsRepoCred extends pulumi.CustomResource { /** * Get an existing GitOpsRepoCred 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 GitOpsRepoCred(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of GitOpsRepoCred. 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'] === GitOpsRepoCred.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["accountId"] = state ? state.accountId : undefined; resourceInputs["agentId"] = state ? state.agentId : undefined; resourceInputs["creds"] = state ? state.creds : undefined; resourceInputs["identifier"] = state ? state.identifier : undefined; resourceInputs["orgId"] = state ? state.orgId : undefined; resourceInputs["projectId"] = state ? state.projectId : undefined; resourceInputs["upsert"] = state ? state.upsert : undefined; } else { const args = argsOrState; if ((!args || args.accountId === undefined) && !opts.urn) { throw new Error("Missing required property 'accountId'"); } if ((!args || args.agentId === undefined) && !opts.urn) { throw new Error("Missing required property 'agentId'"); } if ((!args || args.identifier === undefined) && !opts.urn) { throw new Error("Missing required property 'identifier'"); } resourceInputs["accountId"] = args ? args.accountId : undefined; resourceInputs["agentId"] = args ? args.agentId : undefined; resourceInputs["creds"] = args ? args.creds : undefined; resourceInputs["identifier"] = args ? args.identifier : undefined; resourceInputs["orgId"] = args ? args.orgId : undefined; resourceInputs["projectId"] = args ? args.projectId : undefined; resourceInputs["upsert"] = args ? args.upsert : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(GitOpsRepoCred.__pulumiType, name, resourceInputs, opts); } } exports.GitOpsRepoCred = GitOpsRepoCred; /** @internal */ GitOpsRepoCred.__pulumiType = 'harness:platform/gitOpsRepoCred:GitOpsRepoCred'; //# sourceMappingURL=gitOpsRepoCred.js.map