1. Packages
  2. Tailscale
  3. API Docs
  4. TailnetKey
Tailscale v0.12.2 published on Wednesday, Apr 19, 2023 by Pulumi

tailscale.TailnetKey

Explore with Pulumi AI

tailscale logo
Tailscale v0.12.2 published on Wednesday, Apr 19, 2023 by Pulumi

    The tailnet_key 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

    using System.Collections.Generic;
    using Pulumi;
    using Tailscale = Pulumi.Tailscale;
    
    return await Deployment.RunAsync(() => 
    {
        var sampleKey = new Tailscale.TailnetKey("sampleKey", new()
        {
            Ephemeral = false,
            Expiry = 3600,
            Preauthorized = true,
            Reusable = true,
        });
    
    });
    
    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.NewTailnetKey(ctx, "sampleKey", &tailscale.TailnetKeyArgs{
    			Ephemeral:     pulumi.Bool(false),
    			Expiry:        pulumi.Int(3600),
    			Preauthorized: pulumi.Bool(true),
    			Reusable:      pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tailscale.TailnetKey;
    import com.pulumi.tailscale.TailnetKeyArgs;
    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 sampleKey = new TailnetKey("sampleKey", TailnetKeyArgs.builder()        
                .ephemeral(false)
                .expiry(3600)
                .preauthorized(true)
                .reusable(true)
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_tailscale as tailscale
    
    sample_key = tailscale.TailnetKey("sampleKey",
        ephemeral=False,
        expiry=3600,
        preauthorized=True,
        reusable=True)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as tailscale from "@pulumi/tailscale";
    
    const sampleKey = new tailscale.TailnetKey("sampleKey", {
        ephemeral: false,
        expiry: 3600,
        preauthorized: true,
        reusable: true,
    });
    
    resources:
      sampleKey:
        type: tailscale:TailnetKey
        properties:
          ephemeral: false
          expiry: 3600
          preauthorized: true
          reusable: true
    

    Create TailnetKey Resource

    new TailnetKey(name: string, args?: TailnetKeyArgs, opts?: CustomResourceOptions);
    @overload
    def TailnetKey(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   ephemeral: Optional[bool] = None,
                   expiry: Optional[int] = None,
                   preauthorized: Optional[bool] = None,
                   reusable: Optional[bool] = None,
                   tags: Optional[Sequence[str]] = None)
    @overload
    def TailnetKey(resource_name: str,
                   args: Optional[TailnetKeyArgs] = None,
                   opts: Optional[ResourceOptions] = None)
    func NewTailnetKey(ctx *Context, name string, args *TailnetKeyArgs, opts ...ResourceOption) (*TailnetKey, error)
    public TailnetKey(string name, TailnetKeyArgs? args = null, CustomResourceOptions? opts = null)
    public TailnetKey(String name, TailnetKeyArgs args)
    public TailnetKey(String name, TailnetKeyArgs args, CustomResourceOptions options)
    
    type: tailscale:TailnetKey
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args TailnetKeyArgs
    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 TailnetKeyArgs
    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 TailnetKeyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TailnetKeyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TailnetKeyArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    TailnetKey Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The TailnetKey resource accepts the following input properties:

    Ephemeral bool

    Indicates if the key is ephemeral.

    Expiry int

    The expiry of the key in seconds

    Preauthorized bool

    Determines whether or not the machines authenticated by the key will be authorized for the tailnet by default.

    Reusable bool

    Indicates if the key is reusable or single-use.

    Tags List<string>

    List of tags to apply to the machines authenticated by the key.

    Ephemeral bool

    Indicates if the key is ephemeral.

    Expiry int

    The expiry of the key in seconds

    Preauthorized bool

    Determines whether or not the machines authenticated by the key will be authorized for the tailnet by default.

    Reusable bool

    Indicates if the key is reusable or single-use.

    Tags []string

    List of tags to apply to the machines authenticated by the key.

    ephemeral Boolean

    Indicates if the key is ephemeral.

    expiry Integer

    The expiry of the key in seconds

    preauthorized Boolean

    Determines whether or not the machines authenticated by the key will be authorized for the tailnet by default.

    reusable Boolean

    Indicates if the key is reusable or single-use.

    tags List<String>

    List of tags to apply to the machines authenticated by the key.

    ephemeral boolean

    Indicates if the key is ephemeral.

    expiry number

    The expiry of the key in seconds

    preauthorized boolean

    Determines whether or not the machines authenticated by the key will be authorized for the tailnet by default.

    reusable boolean

    Indicates if the key is reusable or single-use.

    tags string[]

    List of tags to apply to the machines authenticated by the key.

    ephemeral bool

    Indicates if the key is ephemeral.

    expiry int

    The expiry of the key in seconds

    preauthorized bool

    Determines whether or not the machines authenticated by the key will be authorized for the tailnet by default.

    reusable bool

    Indicates if the key is reusable or single-use.

    tags Sequence[str]

    List of tags to apply to the machines authenticated by the key.

    ephemeral Boolean

    Indicates if the key is ephemeral.

    expiry Number

    The expiry of the key in seconds

    preauthorized Boolean

    Determines whether or not the machines authenticated by the key will be authorized for the tailnet by default.

    reusable Boolean

    Indicates if the key is reusable or single-use.

    tags List<String>

    List of tags to apply to the machines authenticated by the key.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the TailnetKey resource produces the following output properties:

    Id string

    The provider-assigned unique ID for this managed resource.

    Key string

    The authentication key

    Id string

    The provider-assigned unique ID for this managed resource.

    Key string

    The authentication key

    id String

    The provider-assigned unique ID for this managed resource.

    key String

    The authentication key

    id string

    The provider-assigned unique ID for this managed resource.

    key string

    The authentication key

    id str

    The provider-assigned unique ID for this managed resource.

    key str

    The authentication key

    id String

    The provider-assigned unique ID for this managed resource.

    key String

    The authentication key

    Look up Existing TailnetKey Resource

    Get an existing TailnetKey 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?: TailnetKeyState, opts?: CustomResourceOptions): TailnetKey
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            ephemeral: Optional[bool] = None,
            expiry: Optional[int] = None,
            key: Optional[str] = None,
            preauthorized: Optional[bool] = None,
            reusable: Optional[bool] = None,
            tags: Optional[Sequence[str]] = None) -> TailnetKey
    func GetTailnetKey(ctx *Context, name string, id IDInput, state *TailnetKeyState, opts ...ResourceOption) (*TailnetKey, error)
    public static TailnetKey Get(string name, Input<string> id, TailnetKeyState? state, CustomResourceOptions? opts = null)
    public static TailnetKey get(String name, Output<String> id, TailnetKeyState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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:
    Ephemeral bool

    Indicates if the key is ephemeral.

    Expiry int

    The expiry of the key in seconds

    Key string

    The authentication key

    Preauthorized bool

    Determines whether or not the machines authenticated by the key will be authorized for the tailnet by default.

    Reusable bool

    Indicates if the key is reusable or single-use.

    Tags List<string>

    List of tags to apply to the machines authenticated by the key.

    Ephemeral bool

    Indicates if the key is ephemeral.

    Expiry int

    The expiry of the key in seconds

    Key string

    The authentication key

    Preauthorized bool

    Determines whether or not the machines authenticated by the key will be authorized for the tailnet by default.

    Reusable bool

    Indicates if the key is reusable or single-use.

    Tags []string

    List of tags to apply to the machines authenticated by the key.

    ephemeral Boolean

    Indicates if the key is ephemeral.

    expiry Integer

    The expiry of the key in seconds

    key String

    The authentication key

    preauthorized Boolean

    Determines whether or not the machines authenticated by the key will be authorized for the tailnet by default.

    reusable Boolean

    Indicates if the key is reusable or single-use.

    tags List<String>

    List of tags to apply to the machines authenticated by the key.

    ephemeral boolean

    Indicates if the key is ephemeral.

    expiry number

    The expiry of the key in seconds

    key string

    The authentication key

    preauthorized boolean

    Determines whether or not the machines authenticated by the key will be authorized for the tailnet by default.

    reusable boolean

    Indicates if the key is reusable or single-use.

    tags string[]

    List of tags to apply to the machines authenticated by the key.

    ephemeral bool

    Indicates if the key is ephemeral.

    expiry int

    The expiry of the key in seconds

    key str

    The authentication key

    preauthorized bool

    Determines whether or not the machines authenticated by the key will be authorized for the tailnet by default.

    reusable bool

    Indicates if the key is reusable or single-use.

    tags Sequence[str]

    List of tags to apply to the machines authenticated by the key.

    ephemeral Boolean

    Indicates if the key is ephemeral.

    expiry Number

    The expiry of the key in seconds

    key String

    The authentication key

    preauthorized Boolean

    Determines whether or not the machines authenticated by the key will be authorized for the tailnet by default.

    reusable Boolean

    Indicates if the key is reusable or single-use.

    tags List<String>

    List of tags to apply to the machines authenticated by the key.

    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.12.2 published on Wednesday, Apr 19, 2023 by Pulumi