@lbrlabs/pulumi-harness
Version:
A Pulumi package for creating and managing Harness resources.
97 lines • 3.98 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.YamlConfig = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Resource for creating a raw YAML configuration in Harness. Note: This works for all objects EXCEPT application objects. This resource uses the config-as-code API's. When updating the `name` or `path` of this resource you should typically also set the `createBeforeDestroy = true` lifecycle setting.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as harness from "@lbrlabs/pulumi-harness";
*
* const test = new harness.YamlConfig("test", {
* content: `harnessApiVersion: '1.0'
* type: KUBERNETES_CLUSTER
* delegateSelectors:
* - k8s
* skipValidation: true
* useKubernetesDelegate: true
*
* `,
* path: "Setup/Cloud Providers/Kubernetes.yaml",
* });
* ```
*
* ## Import
*
* Importing a global config only using the yaml path
*
* ```sh
* $ pulumi import harness:index/yamlConfig:YamlConfig k8s_cloudprovider "Setup/Cloud Providers/kubernetes.yaml"
* ```
*
* Importing a service which requires both the application id and the yaml path.
*
* ```sh
* $ pulumi import harness:index/yamlConfig:YamlConfig k8s_cloudprovider "Setup/Applications/MyApp/Services/MyService/Index.yaml:<APPLICATION_ID>"
* ```
*/
class YamlConfig extends pulumi.CustomResource {
/**
* Get an existing YamlConfig 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 YamlConfig(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of YamlConfig. 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'] === YamlConfig.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["appId"] = state ? state.appId : undefined;
resourceInputs["content"] = state ? state.content : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["path"] = state ? state.path : undefined;
}
else {
const args = argsOrState;
if ((!args || args.content === undefined) && !opts.urn) {
throw new Error("Missing required property 'content'");
}
if ((!args || args.path === undefined) && !opts.urn) {
throw new Error("Missing required property 'path'");
}
resourceInputs["appId"] = args ? args.appId : undefined;
resourceInputs["content"] = args ? args.content : undefined;
resourceInputs["path"] = args ? args.path : undefined;
resourceInputs["name"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(YamlConfig.__pulumiType, name, resourceInputs, opts);
}
}
exports.YamlConfig = YamlConfig;
/** @internal */
YamlConfig.__pulumiType = 'harness:index/yamlConfig:YamlConfig';
//# sourceMappingURL=yamlConfig.js.map