UNPKG

@pulumi/harness

Version:

A Pulumi package for creating and managing Harness resources.

112 lines 4.41 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.EnvironmentClustersMapping = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Resource for mapping environment with Harness Clusters. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as harness from "@pulumi/harness"; * * // mapping a cluster to a project level env * const example = new harness.platform.EnvironmentClustersMapping("example", { * identifier: "mycustomidentifier", * orgId: "orgIdentifer", * projectId: "projectIdentifier", * envId: "exampleEnvId", * clusters: [{ * identifier: "incluster", * name: "in-cluster", * agentIdentifier: "account.gitopsagentdev", * scope: "ACCOUNT", * }], * }); * // mapping two clusters to account level env * const example2 = new harness.platform.EnvironmentClustersMapping("example2", { * identifier: "mycustomidentifier", * envId: "env1", * clusters: [ * { * identifier: "clusterA", * name: "cluster-A", * agentIdentifier: "account.gitopsagentprod", * scope: "ACCOUNT", * }, * { * identifier: "clusterB", * name: "cluster-B", * agentIdentifier: "account.gitopsagentprod", * scope: "ACCOUNT", * }, * ], * }); * ``` * * ## Import * * The `pulumi import` command can be used, for example: */ class EnvironmentClustersMapping extends pulumi.CustomResource { /** * Get an existing EnvironmentClustersMapping 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 EnvironmentClustersMapping(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of EnvironmentClustersMapping. 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'] === EnvironmentClustersMapping.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["clusters"] = state?.clusters; resourceInputs["envId"] = state?.envId; resourceInputs["identifier"] = state?.identifier; resourceInputs["orgId"] = state?.orgId; resourceInputs["projectId"] = state?.projectId; resourceInputs["scope"] = state?.scope; } else { const args = argsOrState; if (args?.envId === undefined && !opts.urn) { throw new Error("Missing required property 'envId'"); } if (args?.identifier === undefined && !opts.urn) { throw new Error("Missing required property 'identifier'"); } resourceInputs["clusters"] = args?.clusters; resourceInputs["envId"] = args?.envId; resourceInputs["identifier"] = args?.identifier; resourceInputs["orgId"] = args?.orgId; resourceInputs["projectId"] = args?.projectId; resourceInputs["scope"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(EnvironmentClustersMapping.__pulumiType, name, resourceInputs, opts); } } exports.EnvironmentClustersMapping = EnvironmentClustersMapping; /** @internal */ EnvironmentClustersMapping.__pulumiType = 'harness:platform/environmentClustersMapping:EnvironmentClustersMapping'; //# sourceMappingURL=environmentClustersMapping.js.map