@pulumi/harness
Version:
A Pulumi package for creating and managing Harness resources.
100 lines • 4 kB
JavaScript
;
// *** 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.Environment = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Resource for creating a Harness environment.
*
* ## Import
*
* The `pulumi import` command can be used, for example:
*
* Import account level environment id
*
* ```sh
* $ pulumi import harness:platform/environment:Environment example <environment_id>
* ```
*
* Import org level environment id
*
* ```sh
* $ pulumi import harness:platform/environment:Environment example <org_id>/<environment_id>
* ```
*
* Import project level environment id
*
* ```sh
* $ pulumi import harness:platform/environment:Environment example <org_id>/<project_id>/<environment_id>
* ```
*/
class Environment extends pulumi.CustomResource {
/**
* Get an existing Environment 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 Environment(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Environment. 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'] === Environment.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["color"] = state?.color;
resourceInputs["description"] = state?.description;
resourceInputs["forceDelete"] = state?.forceDelete;
resourceInputs["gitDetails"] = state?.gitDetails;
resourceInputs["identifier"] = state?.identifier;
resourceInputs["name"] = state?.name;
resourceInputs["orgId"] = state?.orgId;
resourceInputs["projectId"] = state?.projectId;
resourceInputs["tags"] = state?.tags;
resourceInputs["type"] = state?.type;
resourceInputs["yaml"] = state?.yaml;
}
else {
const args = argsOrState;
if (args?.identifier === undefined && !opts.urn) {
throw new Error("Missing required property 'identifier'");
}
if (args?.type === undefined && !opts.urn) {
throw new Error("Missing required property 'type'");
}
resourceInputs["color"] = args?.color;
resourceInputs["description"] = args?.description;
resourceInputs["forceDelete"] = args?.forceDelete;
resourceInputs["gitDetails"] = args?.gitDetails;
resourceInputs["identifier"] = args?.identifier;
resourceInputs["name"] = args?.name;
resourceInputs["orgId"] = args?.orgId;
resourceInputs["projectId"] = args?.projectId;
resourceInputs["tags"] = args?.tags;
resourceInputs["type"] = args?.type;
resourceInputs["yaml"] = args?.yaml;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Environment.__pulumiType, name, resourceInputs, opts);
}
}
exports.Environment = Environment;
/** @internal */
Environment.__pulumiType = 'harness:platform/environment:Environment';
//# sourceMappingURL=environment.js.map