UNPKG

@pulumi/tailscale

Version:

A Pulumi package for creating and managing Tailscale cloud resources.

88 lines 3.73 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.OauthClient = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * The oauthClient resource allows you to create OAuth clients to programmatically interact with the Tailscale API. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as tailscale from "@pulumi/tailscale"; * * const sampleClient = new tailscale.OauthClient("sample_client", { * description: "sample client", * scopes: ["all:read"], * tags: ["tag:test"], * }); * ``` * * ## Import * * Note: Sensitive fields such as the secret key are not returned by the API and will be unset in the Terraform state after import. * * ```sh * $ pulumi import tailscale:index/oauthClient:OauthClient example k1234511CNTRL * ``` */ class OauthClient extends pulumi.CustomResource { /** * Get an existing OauthClient 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 OauthClient(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of OauthClient. 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'] === OauthClient.__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["key"] = state ? state.key : undefined; resourceInputs["scopes"] = state ? state.scopes : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["userId"] = state ? state.userId : undefined; } else { const args = argsOrState; if ((!args || args.scopes === undefined) && !opts.urn) { throw new Error("Missing required property 'scopes'"); } resourceInputs["description"] = args ? args.description : undefined; resourceInputs["scopes"] = args ? args.scopes : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["key"] = undefined /*out*/; resourceInputs["userId"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["key"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(OauthClient.__pulumiType, name, resourceInputs, opts); } } exports.OauthClient = OauthClient; /** @internal */ OauthClient.__pulumiType = 'tailscale:index/oauthClient:OauthClient'; //# sourceMappingURL=oauthClient.js.map