tailscale.OauthClient
Explore with Pulumi AI
The oauth_client resource allows you to create OAuth clients to programmatically interact with the Tailscale API.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as tailscale from "@pulumi/tailscale";
const sampleClient = new tailscale.OauthClient("sample_client", {
description: "sample client",
scopes: ["read:all"],
tags: ["tag:test"],
});
import pulumi
import pulumi_tailscale as tailscale
sample_client = tailscale.OauthClient("sample_client",
description="sample client",
scopes=["read:all"],
tags=["tag:test"])
package main
import (
"github.com/pulumi/pulumi-tailscale/sdk/go/tailscale"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := tailscale.NewOauthClient(ctx, "sample_client", &tailscale.OauthClientArgs{
Description: pulumi.String("sample client"),
Scopes: pulumi.StringArray{
pulumi.String("read:all"),
},
Tags: pulumi.StringArray{
pulumi.String("tag:test"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tailscale = Pulumi.Tailscale;
return await Deployment.RunAsync(() =>
{
var sampleClient = new Tailscale.OauthClient("sample_client", new()
{
Description = "sample client",
Scopes = new[]
{
"read:all",
},
Tags = new[]
{
"tag:test",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tailscale.OauthClient;
import com.pulumi.tailscale.OauthClientArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var sampleClient = new OauthClient("sampleClient", OauthClientArgs.builder()
.description("sample client")
.scopes("read:all")
.tags("tag:test")
.build());
}
}
resources:
sampleClient:
type: tailscale:OauthClient
name: sample_client
properties:
description: sample client
scopes:
- read:all
tags:
- tag:test
Create OauthClient Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new OauthClient(name: string, args: OauthClientArgs, opts?: CustomResourceOptions);
@overload
def OauthClient(resource_name: str,
args: OauthClientArgs,
opts: Optional[ResourceOptions] = None)
@overload
def OauthClient(resource_name: str,
opts: Optional[ResourceOptions] = None,
scopes: Optional[Sequence[str]] = None,
description: Optional[str] = None,
tags: Optional[Sequence[str]] = None,
user_id: Optional[str] = None)
func NewOauthClient(ctx *Context, name string, args OauthClientArgs, opts ...ResourceOption) (*OauthClient, error)
public OauthClient(string name, OauthClientArgs args, CustomResourceOptions? opts = null)
public OauthClient(String name, OauthClientArgs args)
public OauthClient(String name, OauthClientArgs args, CustomResourceOptions options)
type: tailscale:OauthClient
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args OauthClientArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args OauthClientArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args OauthClientArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args OauthClientArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args OauthClientArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var oauthClientResource = new Tailscale.OauthClient("oauthClientResource", new()
{
Scopes = new[]
{
"string",
},
Description = "string",
Tags = new[]
{
"string",
},
UserId = "string",
});
example, err := tailscale.NewOauthClient(ctx, "oauthClientResource", &tailscale.OauthClientArgs{
Scopes: pulumi.StringArray{
pulumi.String("string"),
},
Description: pulumi.String("string"),
Tags: pulumi.StringArray{
pulumi.String("string"),
},
UserId: pulumi.String("string"),
})
var oauthClientResource = new OauthClient("oauthClientResource", OauthClientArgs.builder()
.scopes("string")
.description("string")
.tags("string")
.userId("string")
.build());
oauth_client_resource = tailscale.OauthClient("oauthClientResource",
scopes=["string"],
description="string",
tags=["string"],
user_id="string")
const oauthClientResource = new tailscale.OauthClient("oauthClientResource", {
scopes: ["string"],
description: "string",
tags: ["string"],
userId: "string",
});
type: tailscale:OauthClient
properties:
description: string
scopes:
- string
tags:
- string
userId: string
OauthClient Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The OauthClient resource accepts the following input properties:
- Scopes List<string>
- Scopes to grant to the client. See https://tailscale.com/kb/1215/ for a list of available scopes.
- Description string
- A description of the key consisting of alphanumeric characters. Defaults to
""
. - List<string>
- A list of tags that access tokens generated for the OAuth client will be able to assign to devices. Mandatory if the scopes include "devices:core" or "auth_keys".
- User
Id string - ID of the user who created this key, empty for OAuth clients created by other OAuth clients.
- Scopes []string
- Scopes to grant to the client. See https://tailscale.com/kb/1215/ for a list of available scopes.
- Description string
- A description of the key consisting of alphanumeric characters. Defaults to
""
. - []string
- A list of tags that access tokens generated for the OAuth client will be able to assign to devices. Mandatory if the scopes include "devices:core" or "auth_keys".
- User
Id string - ID of the user who created this key, empty for OAuth clients created by other OAuth clients.
- scopes List<String>
- Scopes to grant to the client. See https://tailscale.com/kb/1215/ for a list of available scopes.
- description String
- A description of the key consisting of alphanumeric characters. Defaults to
""
. - List<String>
- A list of tags that access tokens generated for the OAuth client will be able to assign to devices. Mandatory if the scopes include "devices:core" or "auth_keys".
- user
Id String - ID of the user who created this key, empty for OAuth clients created by other OAuth clients.
- scopes string[]
- Scopes to grant to the client. See https://tailscale.com/kb/1215/ for a list of available scopes.
- description string
- A description of the key consisting of alphanumeric characters. Defaults to
""
. - string[]
- A list of tags that access tokens generated for the OAuth client will be able to assign to devices. Mandatory if the scopes include "devices:core" or "auth_keys".
- user
Id string - ID of the user who created this key, empty for OAuth clients created by other OAuth clients.
- scopes Sequence[str]
- Scopes to grant to the client. See https://tailscale.com/kb/1215/ for a list of available scopes.
- description str
- A description of the key consisting of alphanumeric characters. Defaults to
""
. - Sequence[str]
- A list of tags that access tokens generated for the OAuth client will be able to assign to devices. Mandatory if the scopes include "devices:core" or "auth_keys".
- user_
id str - ID of the user who created this key, empty for OAuth clients created by other OAuth clients.
- scopes List<String>
- Scopes to grant to the client. See https://tailscale.com/kb/1215/ for a list of available scopes.
- description String
- A description of the key consisting of alphanumeric characters. Defaults to
""
. - List<String>
- A list of tags that access tokens generated for the OAuth client will be able to assign to devices. Mandatory if the scopes include "devices:core" or "auth_keys".
- user
Id String - ID of the user who created this key, empty for OAuth clients created by other OAuth clients.
Outputs
All input properties are implicitly available as output properties. Additionally, the OauthClient resource produces the following output properties:
- created_
at str - The creation timestamp of the key in RFC3339 format
- id str
- The provider-assigned unique ID for this managed resource.
- key str
- The client secret, also known as the key. Used with the client ID to generate access tokens.
Look up Existing OauthClient Resource
Get an existing OauthClient resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: OauthClientState, opts?: CustomResourceOptions): OauthClient
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
created_at: Optional[str] = None,
description: Optional[str] = None,
key: Optional[str] = None,
scopes: Optional[Sequence[str]] = None,
tags: Optional[Sequence[str]] = None,
user_id: Optional[str] = None) -> OauthClient
func GetOauthClient(ctx *Context, name string, id IDInput, state *OauthClientState, opts ...ResourceOption) (*OauthClient, error)
public static OauthClient Get(string name, Input<string> id, OauthClientState? state, CustomResourceOptions? opts = null)
public static OauthClient get(String name, Output<String> id, OauthClientState state, CustomResourceOptions options)
resources: _: type: tailscale:OauthClient get: id: ${id}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Created
At string - The creation timestamp of the key in RFC3339 format
- Description string
- A description of the key consisting of alphanumeric characters. Defaults to
""
. - Key string
- The client secret, also known as the key. Used with the client ID to generate access tokens.
- Scopes List<string>
- Scopes to grant to the client. See https://tailscale.com/kb/1215/ for a list of available scopes.
- List<string>
- A list of tags that access tokens generated for the OAuth client will be able to assign to devices. Mandatory if the scopes include "devices:core" or "auth_keys".
- User
Id string - ID of the user who created this key, empty for OAuth clients created by other OAuth clients.
- Created
At string - The creation timestamp of the key in RFC3339 format
- Description string
- A description of the key consisting of alphanumeric characters. Defaults to
""
. - Key string
- The client secret, also known as the key. Used with the client ID to generate access tokens.
- Scopes []string
- Scopes to grant to the client. See https://tailscale.com/kb/1215/ for a list of available scopes.
- []string
- A list of tags that access tokens generated for the OAuth client will be able to assign to devices. Mandatory if the scopes include "devices:core" or "auth_keys".
- User
Id string - ID of the user who created this key, empty for OAuth clients created by other OAuth clients.
- created
At String - The creation timestamp of the key in RFC3339 format
- description String
- A description of the key consisting of alphanumeric characters. Defaults to
""
. - key String
- The client secret, also known as the key. Used with the client ID to generate access tokens.
- scopes List<String>
- Scopes to grant to the client. See https://tailscale.com/kb/1215/ for a list of available scopes.
- List<String>
- A list of tags that access tokens generated for the OAuth client will be able to assign to devices. Mandatory if the scopes include "devices:core" or "auth_keys".
- user
Id String - ID of the user who created this key, empty for OAuth clients created by other OAuth clients.
- created
At string - The creation timestamp of the key in RFC3339 format
- description string
- A description of the key consisting of alphanumeric characters. Defaults to
""
. - key string
- The client secret, also known as the key. Used with the client ID to generate access tokens.
- scopes string[]
- Scopes to grant to the client. See https://tailscale.com/kb/1215/ for a list of available scopes.
- string[]
- A list of tags that access tokens generated for the OAuth client will be able to assign to devices. Mandatory if the scopes include "devices:core" or "auth_keys".
- user
Id string - ID of the user who created this key, empty for OAuth clients created by other OAuth clients.
- created_
at str - The creation timestamp of the key in RFC3339 format
- description str
- A description of the key consisting of alphanumeric characters. Defaults to
""
. - key str
- The client secret, also known as the key. Used with the client ID to generate access tokens.
- scopes Sequence[str]
- Scopes to grant to the client. See https://tailscale.com/kb/1215/ for a list of available scopes.
- Sequence[str]
- A list of tags that access tokens generated for the OAuth client will be able to assign to devices. Mandatory if the scopes include "devices:core" or "auth_keys".
- user_
id str - ID of the user who created this key, empty for OAuth clients created by other OAuth clients.
- created
At String - The creation timestamp of the key in RFC3339 format
- description String
- A description of the key consisting of alphanumeric characters. Defaults to
""
. - key String
- The client secret, also known as the key. Used with the client ID to generate access tokens.
- scopes List<String>
- Scopes to grant to the client. See https://tailscale.com/kb/1215/ for a list of available scopes.
- List<String>
- A list of tags that access tokens generated for the OAuth client will be able to assign to devices. Mandatory if the scopes include "devices:core" or "auth_keys".
- user
Id String - ID of the user who created this key, empty for OAuth clients created by other OAuth clients.
Package Details
- Repository
- tailscale pulumi/pulumi-tailscale
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
tailscale
Terraform Provider.