@lbrlabs/pulumi-harness
Version:
A Pulumi package for creating and managing Harness resources.
103 lines • 4.83 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.FeatureFlagApiKey = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Resource for creating an environment SDK key for Feature Flags.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as harness from "@lbrlabs/pulumi-harness";
*
* const testserverapikey = new harness.platform.FeatureFlagApiKey("testserverapikey", {
* identifier: "testserver",
* description: "this is a server SDK key",
* orgId: "test",
* projectId: "testff",
* envId: "testenv",
* expiredAt: 1713729225,
* type: "Server",
* });
* export const serversdkkey = testserverapikey.apiKey;
* ```
*/
class FeatureFlagApiKey extends pulumi.CustomResource {
/**
* Get an existing FeatureFlagApiKey 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 FeatureFlagApiKey(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of FeatureFlagApiKey. 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'] === FeatureFlagApiKey.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["apiKey"] = state ? state.apiKey : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["envId"] = state ? state.envId : undefined;
resourceInputs["expiredAt"] = state ? state.expiredAt : 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["type"] = state ? state.type : undefined;
}
else {
const args = argsOrState;
if ((!args || args.envId === undefined) && !opts.urn) {
throw new Error("Missing required property 'envId'");
}
if ((!args || args.identifier === undefined) && !opts.urn) {
throw new Error("Missing required property 'identifier'");
}
if ((!args || args.orgId === undefined) && !opts.urn) {
throw new Error("Missing required property 'orgId'");
}
if ((!args || args.projectId === undefined) && !opts.urn) {
throw new Error("Missing required property 'projectId'");
}
if ((!args || args.type === undefined) && !opts.urn) {
throw new Error("Missing required property 'type'");
}
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["envId"] = args ? args.envId : undefined;
resourceInputs["expiredAt"] = args ? args.expiredAt : undefined;
resourceInputs["identifier"] = args ? args.identifier : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["orgId"] = args ? args.orgId : undefined;
resourceInputs["projectId"] = args ? args.projectId : undefined;
resourceInputs["type"] = args ? args.type : undefined;
resourceInputs["apiKey"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["apiKey"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(FeatureFlagApiKey.__pulumiType, name, resourceInputs, opts);
}
}
exports.FeatureFlagApiKey = FeatureFlagApiKey;
/** @internal */
FeatureFlagApiKey.__pulumiType = 'harness:platform/featureFlagApiKey:FeatureFlagApiKey';
//# sourceMappingURL=featureFlagApiKey.js.map