@lbrlabs/pulumi-harness
Version:
A Pulumi package for creating and managing Harness resources.
138 lines • 5.5 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.GitOpsCluster = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Resource for creating a Harness Gitops Cluster.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as harness from "@lbrlabs/pulumi-harness";
*
* // Clusters without Optional tags
* const exampleGitOpsCluster = new harness.platform.GitOpsCluster("exampleGitOpsCluster", {
* identifier: "identifier",
* accountId: "account_id",
* projectId: "project_id",
* orgId: "org_id",
* agentId: "agent_id",
* requests: [{
* upsert: false,
* clusters: [{
* server: "https://kubernetes.default.svc",
* name: "name",
* configs: [{
* tlsClientConfigs: [{
* insecure: true,
* }],
* clusterConnectionType: "IN_CLUSTER",
* }],
* }],
* }],
* });
* // Clusters with Optional tags
* const examplePlatform_gitOpsClusterGitOpsCluster = new harness.platform.GitOpsCluster("examplePlatform/gitOpsClusterGitOpsCluster", {
* identifier: "identifier",
* accountId: "account_id",
* projectId: "project_id",
* orgId: "org_id",
* agentId: "agent_id",
* requests: [{
* upsert: false,
* tags: ["foo:bar"],
* clusters: [{
* server: "https://kubernetes.default.svc",
* name: "name",
* configs: [{
* tlsClientConfigs: [{
* insecure: true,
* }],
* clusterConnectionType: "IN_CLUSTER",
* }],
* }],
* }],
* });
* ```
*
* ## Import
*
* Import a Account level Gitops Cluster
*
* ```sh
* $ pulumi import harness:platform/gitOpsCluster:GitOpsCluster example <agent_id>/<cluster_id>
* ```
*
* Import a Project level Gitops Cluster
*
* ```sh
* $ pulumi import harness:platform/gitOpsCluster:GitOpsCluster example <organization_id>/<project_id>/<agent_id>/<cluster_id>
* ```
*/
class GitOpsCluster extends pulumi.CustomResource {
/**
* Get an existing GitOpsCluster 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 GitOpsCluster(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of GitOpsCluster. 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'] === GitOpsCluster.__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["identifier"] = state ? state.identifier : undefined;
resourceInputs["orgId"] = state ? state.orgId : undefined;
resourceInputs["projectId"] = state ? state.projectId : undefined;
resourceInputs["queries"] = state ? state.queries : undefined;
resourceInputs["requests"] = state ? state.requests : 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["identifier"] = args ? args.identifier : undefined;
resourceInputs["orgId"] = args ? args.orgId : undefined;
resourceInputs["projectId"] = args ? args.projectId : undefined;
resourceInputs["queries"] = args ? args.queries : undefined;
resourceInputs["requests"] = args ? args.requests : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(GitOpsCluster.__pulumiType, name, resourceInputs, opts);
}
}
exports.GitOpsCluster = GitOpsCluster;
/** @internal */
GitOpsCluster.__pulumiType = 'harness:platform/gitOpsCluster:GitOpsCluster';
//# sourceMappingURL=gitOpsCluster.js.map