@lbrlabs/pulumi-harness
Version:
A Pulumi package for creating and managing Harness resources.
118 lines • 4.44 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.Environment = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Resource for creating an environment
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as harness from "@lbrlabs/pulumi-harness";
*
* const testApplication = new harness.Application("testApplication", {});
* const testKubernetes = new harness.service.Kubernetes("testKubernetes", {
* appId: testApplication.id,
* helmVersion: "V2",
* description: "description",
* variables: [
* {
* name: "test",
* value: "test_value",
* type: "TEXT",
* },
* {
* name: "test2",
* value: "test_value2",
* type: "TEXT",
* },
* ],
* });
* const testEnvironment = new harness.Environment("testEnvironment", {
* appId: testApplication.id,
* type: "%[2]s",
* variableOverrides: [
* {
* serviceName: testKubernetes.name,
* name: "test",
* value: "override",
* type: "TEXT",
* },
* {
* serviceName: testKubernetes.name,
* name: "test2",
* value: "override2",
* type: "TEXT",
* },
* ],
* });
* ```
*
* ## Import
*
* Import using the Harness application id and environment id.
*
* ```sh
* $ pulumi import harness:index/environment:Environment dev <application_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, Object.assign(Object.assign({}, 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["appId"] = state ? state.appId : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["type"] = state ? state.type : undefined;
resourceInputs["variableOverrides"] = state ? state.variableOverrides : undefined;
}
else {
const args = argsOrState;
if ((!args || args.appId === undefined) && !opts.urn) {
throw new Error("Missing required property 'appId'");
}
if ((!args || args.type === undefined) && !opts.urn) {
throw new Error("Missing required property 'type'");
}
resourceInputs["appId"] = args ? args.appId : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["type"] = args ? args.type : undefined;
resourceInputs["variableOverrides"] = args ? args.variableOverrides : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Environment.__pulumiType, name, resourceInputs, opts);
}
}
exports.Environment = Environment;
/** @internal */
Environment.__pulumiType = 'harness:index/environment:Environment';
//# sourceMappingURL=environment.js.map