@pulumi/harness
Version:
A Pulumi package for creating and managing Harness resources.
104 lines • 4.43 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.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 "@pulumi/harness";
*
* const testserverapikey = new harness.platform.FeatureFlagApiKey("testserverapikey", {
* identifier: "testserver",
* name: "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, { ...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?.apiKey;
resourceInputs["description"] = state?.description;
resourceInputs["envId"] = state?.envId;
resourceInputs["expiredAt"] = state?.expiredAt;
resourceInputs["identifier"] = state?.identifier;
resourceInputs["name"] = state?.name;
resourceInputs["orgId"] = state?.orgId;
resourceInputs["projectId"] = state?.projectId;
resourceInputs["type"] = state?.type;
}
else {
const args = argsOrState;
if (args?.envId === undefined && !opts.urn) {
throw new Error("Missing required property 'envId'");
}
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'");
}
if (args?.type === undefined && !opts.urn) {
throw new Error("Missing required property 'type'");
}
resourceInputs["description"] = args?.description;
resourceInputs["envId"] = args?.envId;
resourceInputs["expiredAt"] = args?.expiredAt;
resourceInputs["identifier"] = args?.identifier;
resourceInputs["name"] = args?.name;
resourceInputs["orgId"] = args?.orgId;
resourceInputs["projectId"] = args?.projectId;
resourceInputs["type"] = args?.type;
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