@pulumi/harness
Version:
A Pulumi package for creating and managing Harness resources.
98 lines • 4.04 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.FeatureFlagTarget = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Resource for managing Feature Flag Targets.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as harness from "@pulumi/harness";
*
* const target = new harness.platform.FeatureFlagTarget("target", {
* orgId: "test",
* projectId: "test",
* identifier: "MY_FEATURE",
* environment: "MY_ENVIRONMENT",
* name: "MY_FEATURE",
* accountId: "MY_ACCOUNT_ID",
* attributes: {
* foo: "bar",
* },
* });
* ```
*/
class FeatureFlagTarget extends pulumi.CustomResource {
/**
* Get an existing FeatureFlagTarget 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 FeatureFlagTarget(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of FeatureFlagTarget. 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'] === FeatureFlagTarget.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["accountId"] = state?.accountId;
resourceInputs["attributes"] = state?.attributes;
resourceInputs["environment"] = state?.environment;
resourceInputs["identifier"] = state?.identifier;
resourceInputs["name"] = state?.name;
resourceInputs["orgId"] = state?.orgId;
resourceInputs["projectId"] = state?.projectId;
}
else {
const args = argsOrState;
if (args?.accountId === undefined && !opts.urn) {
throw new Error("Missing required property 'accountId'");
}
if (args?.environment === undefined && !opts.urn) {
throw new Error("Missing required property 'environment'");
}
if (args?.identifier === undefined && !opts.urn) {
throw new Error("Missing required property 'identifier'");
}
if (args?.orgId === undefined && !opts.urn) {
throw new Error("Missing required property 'orgId'");
}
if (args?.projectId === undefined && !opts.urn) {
throw new Error("Missing required property 'projectId'");
}
resourceInputs["accountId"] = args?.accountId;
resourceInputs["attributes"] = args?.attributes;
resourceInputs["environment"] = args?.environment;
resourceInputs["identifier"] = args?.identifier;
resourceInputs["name"] = args?.name;
resourceInputs["orgId"] = args?.orgId;
resourceInputs["projectId"] = args?.projectId;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(FeatureFlagTarget.__pulumiType, name, resourceInputs, opts);
}
}
exports.FeatureFlagTarget = FeatureFlagTarget;
/** @internal */
FeatureFlagTarget.__pulumiType = 'harness:platform/featureFlagTarget:FeatureFlagTarget';
//# sourceMappingURL=featureFlagTarget.js.map