@pulumi/harness
Version:
A Pulumi package for creating and managing Harness resources.
100 lines • 4.41 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.Policy = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Resource for creating a Harness Policy.
*
* ## Import
*
* The `pulumi import` command can be used, for example:
*
* Import using the organization id
*
* ```sh
* $ pulumi import harness:platform/policy:Policy example <organization_id>
* ```
*/
class Policy extends pulumi.CustomResource {
/**
* Get an existing Policy 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 Policy(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Policy. 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'] === Policy.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["description"] = state?.description;
resourceInputs["gitBaseBranch"] = state?.gitBaseBranch;
resourceInputs["gitBranch"] = state?.gitBranch;
resourceInputs["gitCommitMsg"] = state?.gitCommitMsg;
resourceInputs["gitCommitSha"] = state?.gitCommitSha;
resourceInputs["gitConnectorRef"] = state?.gitConnectorRef;
resourceInputs["gitFileId"] = state?.gitFileId;
resourceInputs["gitImport"] = state?.gitImport;
resourceInputs["gitIsNewBranch"] = state?.gitIsNewBranch;
resourceInputs["gitPath"] = state?.gitPath;
resourceInputs["gitRepo"] = state?.gitRepo;
resourceInputs["identifier"] = state?.identifier;
resourceInputs["name"] = state?.name;
resourceInputs["orgId"] = state?.orgId;
resourceInputs["projectId"] = state?.projectId;
resourceInputs["rego"] = state?.rego;
resourceInputs["tags"] = state?.tags;
}
else {
const args = argsOrState;
if (args?.identifier === undefined && !opts.urn) {
throw new Error("Missing required property 'identifier'");
}
if (args?.rego === undefined && !opts.urn) {
throw new Error("Missing required property 'rego'");
}
resourceInputs["description"] = args?.description;
resourceInputs["gitBaseBranch"] = args?.gitBaseBranch;
resourceInputs["gitBranch"] = args?.gitBranch;
resourceInputs["gitCommitMsg"] = args?.gitCommitMsg;
resourceInputs["gitCommitSha"] = args?.gitCommitSha;
resourceInputs["gitConnectorRef"] = args?.gitConnectorRef;
resourceInputs["gitFileId"] = args?.gitFileId;
resourceInputs["gitImport"] = args?.gitImport;
resourceInputs["gitIsNewBranch"] = args?.gitIsNewBranch;
resourceInputs["gitPath"] = args?.gitPath;
resourceInputs["gitRepo"] = args?.gitRepo;
resourceInputs["identifier"] = args?.identifier;
resourceInputs["name"] = args?.name;
resourceInputs["orgId"] = args?.orgId;
resourceInputs["projectId"] = args?.projectId;
resourceInputs["rego"] = args?.rego;
resourceInputs["tags"] = args?.tags;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Policy.__pulumiType, name, resourceInputs, opts);
}
}
exports.Policy = Policy;
/** @internal */
Policy.__pulumiType = 'harness:platform/policy:Policy';
//# sourceMappingURL=policy.js.map