@lbrlabs/pulumi-harness
Version:
A Pulumi package for creating and managing Harness resources.
122 lines • 5.58 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.GitOpsRepository = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Resource for creating Harness Gitops Repositories.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as harness from "@lbrlabs/pulumi-harness";
*
* const example = new harness.platform.GitOpsRepository("example", {
* accountId: "account_id",
* agentId: "agent_id",
* identifier: "identifier",
* orgId: "org_id",
* projectId: "project_id",
* repos: [{
* connectionType: "HTTPS_ANONYMOUS",
* insecure: true,
* name: "repo_name",
* repo: "https://github.com/willycoll/argocd-example-apps.git",
* }],
* upsert: true,
* });
* ```
*
* ## Import
*
* Import a Account level Gitops Repository
*
* ```sh
* $ pulumi import harness:platform/gitOpsRepository:GitOpsRepository example <agent_id>/<respository_id>
* ```
*
* Import a Project level Gitops Repository
*
* ```sh
* $ pulumi import harness:platform/gitOpsRepository:GitOpsRepository example <organization_id>/<project_id>/<agent_id>/<respository_id>
* ```
*/
class GitOpsRepository extends pulumi.CustomResource {
/**
* Get an existing GitOpsRepository 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 GitOpsRepository(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of GitOpsRepository. 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'] === GitOpsRepository.__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["credsOnly"] = state ? state.credsOnly : undefined;
resourceInputs["identifier"] = state ? state.identifier : undefined;
resourceInputs["orgId"] = state ? state.orgId : undefined;
resourceInputs["projectId"] = state ? state.projectId : undefined;
resourceInputs["queryForceRefresh"] = state ? state.queryForceRefresh : undefined;
resourceInputs["queryProject"] = state ? state.queryProject : undefined;
resourceInputs["queryRepo"] = state ? state.queryRepo : undefined;
resourceInputs["repos"] = state ? state.repos : undefined;
resourceInputs["updateMasks"] = state ? state.updateMasks : 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'");
}
if ((!args || args.repos === undefined) && !opts.urn) {
throw new Error("Missing required property 'repos'");
}
resourceInputs["accountId"] = args ? args.accountId : undefined;
resourceInputs["agentId"] = args ? args.agentId : undefined;
resourceInputs["credsOnly"] = args ? args.credsOnly : undefined;
resourceInputs["identifier"] = args ? args.identifier : undefined;
resourceInputs["orgId"] = args ? args.orgId : undefined;
resourceInputs["projectId"] = args ? args.projectId : undefined;
resourceInputs["queryForceRefresh"] = args ? args.queryForceRefresh : undefined;
resourceInputs["queryProject"] = args ? args.queryProject : undefined;
resourceInputs["queryRepo"] = args ? args.queryRepo : undefined;
resourceInputs["repos"] = args ? args.repos : undefined;
resourceInputs["updateMasks"] = args ? args.updateMasks : undefined;
resourceInputs["upsert"] = args ? args.upsert : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(GitOpsRepository.__pulumiType, name, resourceInputs, opts);
}
}
exports.GitOpsRepository = GitOpsRepository;
/** @internal */
GitOpsRepository.__pulumiType = 'harness:platform/gitOpsRepository:GitOpsRepository';
//# sourceMappingURL=gitOpsRepository.js.map