@pulumi/tailscale
Version:
A Pulumi package for creating and managing Tailscale cloud resources.
103 lines • 4.7 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.TailnetKey = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* The tailnetKey resource allows you to create pre-authentication keys that can register new nodes without needing to sign in via a web browser. See https://tailscale.com/kb/1085/auth-keys for more information
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as tailscale from "@pulumi/tailscale";
*
* const sampleKey = new tailscale.TailnetKey("sample_key", {
* reusable: true,
* ephemeral: false,
* preauthorized: true,
* expiry: 3600,
* description: "Sample key",
* });
* ```
*
* ## Import
*
* Tailnet key can be imported using the key id, e.g.,
*
* ```sh
* $ pulumi import tailscale:index/tailnetKey:TailnetKey sample_key 123456789
* ```
*
* -> ** Note ** the `key` attribute will not be populated on import as this attribute is only populated
*
* on resource creation.
*/
class TailnetKey extends pulumi.CustomResource {
/**
* Get an existing TailnetKey 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 TailnetKey(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of TailnetKey. 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'] === TailnetKey.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["createdAt"] = state ? state.createdAt : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["ephemeral"] = state ? state.ephemeral : undefined;
resourceInputs["expiresAt"] = state ? state.expiresAt : undefined;
resourceInputs["expiry"] = state ? state.expiry : undefined;
resourceInputs["invalid"] = state ? state.invalid : undefined;
resourceInputs["key"] = state ? state.key : undefined;
resourceInputs["preauthorized"] = state ? state.preauthorized : undefined;
resourceInputs["recreateIfInvalid"] = state ? state.recreateIfInvalid : undefined;
resourceInputs["reusable"] = state ? state.reusable : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["userId"] = state ? state.userId : undefined;
}
else {
const args = argsOrState;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["ephemeral"] = args ? args.ephemeral : undefined;
resourceInputs["expiry"] = args ? args.expiry : undefined;
resourceInputs["preauthorized"] = args ? args.preauthorized : undefined;
resourceInputs["recreateIfInvalid"] = args ? args.recreateIfInvalid : undefined;
resourceInputs["reusable"] = args ? args.reusable : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["userId"] = args ? args.userId : undefined;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["expiresAt"] = undefined /*out*/;
resourceInputs["invalid"] = undefined /*out*/;
resourceInputs["key"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["key"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(TailnetKey.__pulumiType, name, resourceInputs, opts);
}
}
exports.TailnetKey = TailnetKey;
/** @internal */
TailnetKey.__pulumiType = 'tailscale:index/tailnetKey:TailnetKey';
//# sourceMappingURL=tailnetKey.js.map