UNPKG

@pulumi/tailscale

Version:

A Pulumi package for creating and managing Tailscale cloud resources.

103 lines 4.29 kB
"use strict"; // *** 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, { ...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?.createdAt; resourceInputs["description"] = state?.description; resourceInputs["ephemeral"] = state?.ephemeral; resourceInputs["expiresAt"] = state?.expiresAt; resourceInputs["expiry"] = state?.expiry; resourceInputs["invalid"] = state?.invalid; resourceInputs["key"] = state?.key; resourceInputs["preauthorized"] = state?.preauthorized; resourceInputs["recreateIfInvalid"] = state?.recreateIfInvalid; resourceInputs["reusable"] = state?.reusable; resourceInputs["tags"] = state?.tags; resourceInputs["userId"] = state?.userId; } else { const args = argsOrState; resourceInputs["description"] = args?.description; resourceInputs["ephemeral"] = args?.ephemeral; resourceInputs["expiry"] = args?.expiry; resourceInputs["preauthorized"] = args?.preauthorized; resourceInputs["recreateIfInvalid"] = args?.recreateIfInvalid; resourceInputs["reusable"] = args?.reusable; resourceInputs["tags"] = args?.tags; resourceInputs["userId"] = args?.userId; 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