@pulumi/tailscale
Version:
A Pulumi package for creating and managing Tailscale cloud resources.
90 lines • 3.58 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.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
*
* The `pulumi import` command can be used, for example:
*
* 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, { ...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?.createdAt;
resourceInputs["description"] = state?.description;
resourceInputs["key"] = state?.key;
resourceInputs["scopes"] = state?.scopes;
resourceInputs["tags"] = state?.tags;
resourceInputs["userId"] = state?.userId;
}
else {
const args = argsOrState;
if (args?.scopes === undefined && !opts.urn) {
throw new Error("Missing required property 'scopes'");
}
resourceInputs["description"] = args?.description;
resourceInputs["scopes"] = args?.scopes;
resourceInputs["tags"] = args?.tags;
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