1. Packages
  2. Tailscale Provider
  3. API Docs
  4. OauthClient
Tailscale v0.20.0 published on Tuesday, May 6, 2025 by Pulumi

tailscale.OauthClient

Explore with Pulumi AI

tailscale logo
Tailscale v0.20.0 published on Tuesday, May 6, 2025 by Pulumi

    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 "".
    Tags 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".
    UserId 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 "".
    Tags []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".
    UserId 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 "".
    tags 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".
    userId 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 "".
    tags 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".
    userId 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 "".
    tags 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 "".
    tags 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".
    userId 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:

    CreatedAt string
    The creation timestamp of the key in RFC3339 format
    Id string
    The provider-assigned unique ID for this managed resource.
    Key string
    The client secret, also known as the key. Used with the client ID to generate access tokens.
    CreatedAt string
    The creation timestamp of the key in RFC3339 format
    Id string
    The provider-assigned unique ID for this managed resource.
    Key string
    The client secret, also known as the key. Used with the client ID to generate access tokens.
    createdAt String
    The creation timestamp of the key in RFC3339 format
    id String
    The provider-assigned unique ID for this managed resource.
    key String
    The client secret, also known as the key. Used with the client ID to generate access tokens.
    createdAt string
    The creation timestamp of the key in RFC3339 format
    id string
    The provider-assigned unique ID for this managed resource.
    key string
    The client secret, also known as the key. Used with the client ID to generate access tokens.
    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.
    createdAt String
    The creation timestamp of the key in RFC3339 format
    id String
    The provider-assigned unique ID for this managed resource.
    key String
    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.
    The following state arguments are supported:
    CreatedAt 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.
    Tags 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".
    UserId string
    ID of the user who created this key, empty for OAuth clients created by other OAuth clients.
    CreatedAt 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.
    Tags []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".
    UserId string
    ID of the user who created this key, empty for OAuth clients created by other OAuth clients.
    createdAt 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.
    tags 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".
    userId String
    ID of the user who created this key, empty for OAuth clients created by other OAuth clients.
    createdAt 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.
    tags 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".
    userId 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.
    tags 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.
    createdAt 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.
    tags 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".
    userId 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.
    tailscale logo
    Tailscale v0.20.0 published on Tuesday, May 6, 2025 by Pulumi