@pulumi/harness
Version:
A Pulumi package for creating and managing Harness resources.
106 lines • 4.49 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.FeatureFlagTargetGroup = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Resource for creating a Harness Feature Flag Target Group.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as harness from "@pulumi/harness";
*
* const target = new harness.platform.FeatureFlagTargetGroup("target", {
* orgId: "test",
* projectId: "test",
* identifier: "MY_FEATURE",
* environment: "MY_ENVIRONMENT",
* name: "MY_FEATURE",
* accountId: "MY_ACCOUNT_ID",
* includeds: ["target_id_1"],
* excludeds: ["target_id_2"],
* rules: {
* attribute: "MY_ATTRIBUTE",
* operator: "equal",
* value: "MY_VALUE",
* },
* });
* ```
*/
class FeatureFlagTargetGroup extends pulumi.CustomResource {
/**
* Get an existing FeatureFlagTargetGroup 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 FeatureFlagTargetGroup(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of FeatureFlagTargetGroup. 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'] === FeatureFlagTargetGroup.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["accountId"] = state?.accountId;
resourceInputs["environment"] = state?.environment;
resourceInputs["excludeds"] = state?.excludeds;
resourceInputs["identifier"] = state?.identifier;
resourceInputs["includeds"] = state?.includeds;
resourceInputs["name"] = state?.name;
resourceInputs["orgId"] = state?.orgId;
resourceInputs["projectId"] = state?.projectId;
resourceInputs["rules"] = state?.rules;
}
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["environment"] = args?.environment;
resourceInputs["excludeds"] = args?.excludeds;
resourceInputs["identifier"] = args?.identifier;
resourceInputs["includeds"] = args?.includeds;
resourceInputs["name"] = args?.name;
resourceInputs["orgId"] = args?.orgId;
resourceInputs["projectId"] = args?.projectId;
resourceInputs["rules"] = args?.rules;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(FeatureFlagTargetGroup.__pulumiType, name, resourceInputs, opts);
}
}
exports.FeatureFlagTargetGroup = FeatureFlagTargetGroup;
/** @internal */
FeatureFlagTargetGroup.__pulumiType = 'harness:platform/featureFlagTargetGroup:FeatureFlagTargetGroup';
//# sourceMappingURL=featureFlagTargetGroup.js.map