UNPKG

@lbrlabs/pulumi-harness

Version:

A Pulumi package for creating and managing Harness resources.

108 lines 4.5 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.ApplicationGitSync = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Resource for configuring application git sync. * * ## 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 githubToken = new harness.EncryptedText("githubToken", { * value: "<TOKEN>", * secretManagerId: _default.then(_default => _default.id), * }); * const myrepo = new harness.GitConnector("myrepo", { * url: "https://github.com/someorg/myrepo", * branch: "main", * generateWebhookUrl: true, * username: "someuser", * passwordSecretId: githubToken.id, * urlType: "REPO", * }); * const exampleApplication = new harness.Application("exampleApplication", {}); * const exampleApplicationGitSync = new harness.ApplicationGitSync("exampleApplicationGitSync", { * appId: exampleApplication.id, * connectorId: myrepo.id, * branch: "main", * enabled: false, * }); * ``` * * ## Import * * Import using the Harness application id * * ```sh * $ pulumi import harness:index/applicationGitSync:ApplicationGitSync myapp Xyz123 * ``` */ class ApplicationGitSync extends pulumi.CustomResource { /** * Get an existing ApplicationGitSync 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 ApplicationGitSync(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of ApplicationGitSync. 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'] === ApplicationGitSync.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["appId"] = state ? state.appId : undefined; resourceInputs["branch"] = state ? state.branch : undefined; resourceInputs["connectorId"] = state ? state.connectorId : undefined; resourceInputs["enabled"] = state ? state.enabled : undefined; resourceInputs["repositoryName"] = state ? state.repositoryName : undefined; } else { const args = argsOrState; if ((!args || args.appId === undefined) && !opts.urn) { throw new Error("Missing required property 'appId'"); } if ((!args || args.branch === undefined) && !opts.urn) { throw new Error("Missing required property 'branch'"); } if ((!args || args.connectorId === undefined) && !opts.urn) { throw new Error("Missing required property 'connectorId'"); } resourceInputs["appId"] = args ? args.appId : undefined; resourceInputs["branch"] = args ? args.branch : undefined; resourceInputs["connectorId"] = args ? args.connectorId : undefined; resourceInputs["enabled"] = args ? args.enabled : undefined; resourceInputs["repositoryName"] = args ? args.repositoryName : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ApplicationGitSync.__pulumiType, name, resourceInputs, opts); } } exports.ApplicationGitSync = ApplicationGitSync; /** @internal */ ApplicationGitSync.__pulumiType = 'harness:index/applicationGitSync:ApplicationGitSync'; //# sourceMappingURL=applicationGitSync.js.map