@lbrlabs/pulumi-harness
Version:
A Pulumi package for creating and managing Harness resources.
114 lines • 5.31 kB
JavaScript
;
// *** 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.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 "@lbrlabs/pulumi-harness";
* import * as harness from "@pulumi/harness";
*
* const default = harness.getSecretManager({
* "default": true,
* });
* const exampleEncryptedText = new harness.EncryptedText("exampleEncryptedText", {
* value: "foo",
* secretManagerId: _default.then(_default => _default.id),
* });
* const exampleGitConnector = new harness.GitConnector("exampleGitConnector", {
* url: "https://github.com/harness/terraform-provider-harness",
* branch: "master",
* generateWebhookUrl: true,
* passwordSecretId: exampleEncryptedText.id,
* urlType: "REPO",
* username: "someuser",
* });
* ```
*
* ## Import
*
* 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, Object.assign(Object.assign({}, 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 ? state.branch : undefined;
resourceInputs["commitDetails"] = state ? state.commitDetails : undefined;
resourceInputs["createdAt"] = state ? state.createdAt : undefined;
resourceInputs["delegateSelectors"] = state ? state.delegateSelectors : undefined;
resourceInputs["generateWebhookUrl"] = state ? state.generateWebhookUrl : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["passwordSecretId"] = state ? state.passwordSecretId : undefined;
resourceInputs["sshSettingId"] = state ? state.sshSettingId : undefined;
resourceInputs["url"] = state ? state.url : undefined;
resourceInputs["urlType"] = state ? state.urlType : undefined;
resourceInputs["usageScopes"] = state ? state.usageScopes : undefined;
resourceInputs["username"] = state ? state.username : undefined;
resourceInputs["webhookUrl"] = state ? state.webhookUrl : undefined;
}
else {
const args = argsOrState;
if ((!args || args.url === undefined) && !opts.urn) {
throw new Error("Missing required property 'url'");
}
if ((!args || args.urlType === undefined) && !opts.urn) {
throw new Error("Missing required property 'urlType'");
}
resourceInputs["branch"] = args ? args.branch : undefined;
resourceInputs["commitDetails"] = args ? args.commitDetails : undefined;
resourceInputs["delegateSelectors"] = args ? args.delegateSelectors : undefined;
resourceInputs["generateWebhookUrl"] = args ? args.generateWebhookUrl : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["passwordSecretId"] = args ? args.passwordSecretId : undefined;
resourceInputs["sshSettingId"] = args ? args.sshSettingId : undefined;
resourceInputs["url"] = args ? args.url : undefined;
resourceInputs["urlType"] = args ? args.urlType : undefined;
resourceInputs["usageScopes"] = args ? args.usageScopes : undefined;
resourceInputs["username"] = args ? args.username : undefined;
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