UNPKG

@pulumi/harness

Version:

A Pulumi package for creating and managing Harness resources.

117 lines 4.8 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.GitConnector = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Resource for creating a git connector * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as harness from "@pulumi/harness"; * * const _default = harness.getSecretManager({ * "default": true, * }); * const example = new harness.EncryptedText("example", { * name: "example-secret", * value: "foo", * secretManagerId: _default.then(_default => _default.id), * }); * const exampleGitConnector = new harness.GitConnector("example", { * name: "example", * url: "https://github.com/harness/terraform-provider-harness", * branch: "master", * generateWebhookUrl: true, * passwordSecretId: example.id, * urlType: "REPO", * username: "someuser", * }); * ``` * * ## Import * * The `pulumi import` command can be used, for example: * * Import using the Harness git connector id * * ```sh * $ pulumi import harness:index/gitConnector:GitConnector example <connector_id> * ``` */ class GitConnector extends pulumi.CustomResource { /** * Get an existing GitConnector 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 GitConnector(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of GitConnector. 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'] === GitConnector.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["branch"] = state?.branch; resourceInputs["commitDetails"] = state?.commitDetails; resourceInputs["createdAt"] = state?.createdAt; resourceInputs["delegateSelectors"] = state?.delegateSelectors; resourceInputs["generateWebhookUrl"] = state?.generateWebhookUrl; resourceInputs["name"] = state?.name; resourceInputs["passwordSecretId"] = state?.passwordSecretId; resourceInputs["sshSettingId"] = state?.sshSettingId; resourceInputs["url"] = state?.url; resourceInputs["urlType"] = state?.urlType; resourceInputs["usageScopes"] = state?.usageScopes; resourceInputs["username"] = state?.username; resourceInputs["webhookUrl"] = state?.webhookUrl; } else { const args = argsOrState; if (args?.url === undefined && !opts.urn) { throw new Error("Missing required property 'url'"); } if (args?.urlType === undefined && !opts.urn) { throw new Error("Missing required property 'urlType'"); } resourceInputs["branch"] = args?.branch; resourceInputs["commitDetails"] = args?.commitDetails; resourceInputs["delegateSelectors"] = args?.delegateSelectors; resourceInputs["generateWebhookUrl"] = args?.generateWebhookUrl; resourceInputs["name"] = args?.name; resourceInputs["passwordSecretId"] = args?.passwordSecretId; resourceInputs["sshSettingId"] = args?.sshSettingId; resourceInputs["url"] = args?.url; resourceInputs["urlType"] = args?.urlType; resourceInputs["usageScopes"] = args?.usageScopes; resourceInputs["username"] = args?.username; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["webhookUrl"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(GitConnector.__pulumiType, name, resourceInputs, opts); } } exports.GitConnector = GitConnector; /** @internal */ GitConnector.__pulumiType = 'harness:index/gitConnector:GitConnector'; //# sourceMappingURL=gitConnector.js.map