@lbrlabs/pulumi-harness
Version:
A Pulumi package for creating and managing Harness resources.
145 lines • 5.77 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.ManualFreeze = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Resource for Manual Deployment Freeze Window.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as harness from "@lbrlabs/pulumi-harness";
*
* const example = new harness.platform.ManualFreeze("example", {
* accountId: "accountIdentifier",
* identifier: "identifier",
* orgId: "orgIdentifier",
* projectId: "projectIdentifier",
* yaml: `freeze:
* name: freezeName
* identifier: identifier
* entityConfigs:
* - name: r1
* entities:
* - filterType: All
* type: Org
* - filterType: All
* type: Project
* - filterType: All
* type: Service
* - filterType: All
* type: EnvType
* status: Disabled
* description: hi
* windows:
* - timeZone: Asia/Calcutta
* startTime: 2023-05-03 04:16 PM
* duration: 30m
* recurrence:
* type: Daily
* notificationRules: []
* tags: {}
*
* `,
* });
* ```
*
* ## Import
*
* Import an account level freeze
*
* ```sh
* $ pulumi import harness:platform/manualFreeze:ManualFreeze example <freeze_id>
* ```
*
* Import an organization level freeze
*
* ```sh
* $ pulumi import harness:platform/manualFreeze:ManualFreeze example <org_id>/<freeze_id>
* ```
*
* Import project level freeze
*
* ```sh
* $ pulumi import harness:platform/manualFreeze:ManualFreeze example <org_id>/<project_id>/<freeze_id>
* ```
*/
class ManualFreeze extends pulumi.CustomResource {
/**
* Get an existing ManualFreeze 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 ManualFreeze(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of ManualFreeze. 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'] === ManualFreeze.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["accountId"] = state ? state.accountId : undefined;
resourceInputs["currentOrUpcomingWindows"] = state ? state.currentOrUpcomingWindows : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["freezeWindows"] = state ? state.freezeWindows : undefined;
resourceInputs["identifier"] = state ? state.identifier : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["orgId"] = state ? state.orgId : undefined;
resourceInputs["projectId"] = state ? state.projectId : undefined;
resourceInputs["scope"] = state ? state.scope : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["type"] = state ? state.type : undefined;
resourceInputs["yaml"] = state ? state.yaml : undefined;
}
else {
const args = argsOrState;
if ((!args || args.accountId === undefined) && !opts.urn) {
throw new Error("Missing required property 'accountId'");
}
if ((!args || args.identifier === undefined) && !opts.urn) {
throw new Error("Missing required property 'identifier'");
}
if ((!args || args.yaml === undefined) && !opts.urn) {
throw new Error("Missing required property 'yaml'");
}
resourceInputs["accountId"] = args ? args.accountId : undefined;
resourceInputs["identifier"] = args ? args.identifier : undefined;
resourceInputs["orgId"] = args ? args.orgId : undefined;
resourceInputs["projectId"] = args ? args.projectId : undefined;
resourceInputs["yaml"] = args ? args.yaml : undefined;
resourceInputs["currentOrUpcomingWindows"] = undefined /*out*/;
resourceInputs["description"] = undefined /*out*/;
resourceInputs["freezeWindows"] = undefined /*out*/;
resourceInputs["name"] = undefined /*out*/;
resourceInputs["scope"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
resourceInputs["tags"] = undefined /*out*/;
resourceInputs["type"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ManualFreeze.__pulumiType, name, resourceInputs, opts);
}
}
exports.ManualFreeze = ManualFreeze;
/** @internal */
ManualFreeze.__pulumiType = 'harness:platform/manualFreeze:ManualFreeze';
//# sourceMappingURL=manualFreeze.js.map