@emailbob/twingate
Version:
A Pulumi package for creating and managing Twingate cloud resources.
76 lines • 3.76 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.TwingateConnectorTokens = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* This resource type will generate tokens for a Connector, which are needed to successfully provision one on your network. The Connector itself has its own resource type and must be created before you can provision tokens.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as twingate from "@emailbob/twingate";
*
* const awsNetwork = new twingate.TwingateRemoteNetwork("awsNetwork", {});
* const awsConnector = new twingate.TwingateConnector("awsConnector", {remoteNetworkId: awsNetwork.id});
* const awsConnectorTokens = new twingate.TwingateConnectorTokens("awsConnectorTokens", {connectorId: awsConnector.id});
* ```
* <!--End PulumiCodeChooser -->
*/
class TwingateConnectorTokens extends pulumi.CustomResource {
/**
* Get an existing TwingateConnectorTokens 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 TwingateConnectorTokens(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of TwingateConnectorTokens. 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'] === TwingateConnectorTokens.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["accessToken"] = state ? state.accessToken : undefined;
resourceInputs["connectorId"] = state ? state.connectorId : undefined;
resourceInputs["keepers"] = state ? state.keepers : undefined;
resourceInputs["refreshToken"] = state ? state.refreshToken : undefined;
}
else {
const args = argsOrState;
if ((!args || args.connectorId === undefined) && !opts.urn) {
throw new Error("Missing required property 'connectorId'");
}
resourceInputs["connectorId"] = args ? args.connectorId : undefined;
resourceInputs["keepers"] = args ? args.keepers : undefined;
resourceInputs["accessToken"] = undefined /*out*/;
resourceInputs["refreshToken"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["accessToken", "refreshToken"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(TwingateConnectorTokens.__pulumiType, name, resourceInputs, opts);
}
}
exports.TwingateConnectorTokens = TwingateConnectorTokens;
/** @internal */
TwingateConnectorTokens.__pulumiType = 'twingate:index/twingateConnectorTokens:TwingateConnectorTokens';
//# sourceMappingURL=twingateConnectorTokens.js.map