@emailbob/twingate
Version:
A Pulumi package for creating and managing Twingate cloud resources.
82 lines • 4.19 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.TwingateServiceAccountKey = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* A Service Key authorizes access to all Resources assigned to a Service Account.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as time from "@pulumiverse/time";
* import * as twingate from "@emailbob/twingate";
*
* const githubActionsProd = new twingate.TwingateServiceAccount("githubActionsProd", {});
* const githubKey = new twingate.TwingateServiceAccountKey("githubKey", {serviceAccountId: githubActionsProd.id});
* // Key rotation using the time provider (see https://registry.terraform.io/providers/hashicorp/time/latest)
* const keyRotationRotating = new time.Rotating("keyRotationRotating", {rotationDays: 30});
* const keyRotationStatic = new time.Static("keyRotationStatic", {rfc3339: keyRotationRotating.rfc3339});
* const githubKeyWithRotation = new twingate.TwingateServiceAccountKey("githubKeyWithRotation", {serviceAccountId: githubActionsProd.id});
* ```
* <!--End PulumiCodeChooser -->
*/
class TwingateServiceAccountKey extends pulumi.CustomResource {
/**
* Get an existing TwingateServiceAccountKey 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 TwingateServiceAccountKey(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of TwingateServiceAccountKey. 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'] === TwingateServiceAccountKey.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["expirationTime"] = state ? state.expirationTime : undefined;
resourceInputs["isActive"] = state ? state.isActive : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["serviceAccountId"] = state ? state.serviceAccountId : undefined;
resourceInputs["token"] = state ? state.token : undefined;
}
else {
const args = argsOrState;
if ((!args || args.serviceAccountId === undefined) && !opts.urn) {
throw new Error("Missing required property 'serviceAccountId'");
}
resourceInputs["expirationTime"] = args ? args.expirationTime : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["serviceAccountId"] = args ? args.serviceAccountId : undefined;
resourceInputs["isActive"] = undefined /*out*/;
resourceInputs["token"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["token"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(TwingateServiceAccountKey.__pulumiType, name, resourceInputs, opts);
}
}
exports.TwingateServiceAccountKey = TwingateServiceAccountKey;
/** @internal */
TwingateServiceAccountKey.__pulumiType = 'twingate:index/twingateServiceAccountKey:TwingateServiceAccountKey';
//# sourceMappingURL=twingateServiceAccountKey.js.map