1. Packages
  2. Twingate
  3. API Docs
  4. TwingateConnectorTokens
Twingate v3.0.12 published on Tuesday, Nov 5, 2024 by Twingate

twingate.TwingateConnectorTokens

Explore with Pulumi AI

twingate logo
Twingate v3.0.12 published on Tuesday, Nov 5, 2024 by Twingate

    This resource type will generate tokens for a Connector, which are needed to successfully provision one on your network. The Connector itself has its own resource type and must be created before you can provision tokens.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as twingate from "@twingate/pulumi-twingate";
    
    const awsNetwork = new twingate.TwingateRemoteNetwork("awsNetwork", {});
    const awsConnector = new twingate.TwingateConnector("awsConnector", {remoteNetworkId: awsNetwork.id});
    const awsConnectorTokens = new twingate.TwingateConnectorTokens("awsConnectorTokens", {connectorId: awsConnector.id});
    
    import pulumi
    import pulumi_twingate as twingate
    
    aws_network = twingate.TwingateRemoteNetwork("awsNetwork")
    aws_connector = twingate.TwingateConnector("awsConnector", remote_network_id=aws_network.id)
    aws_connector_tokens = twingate.TwingateConnectorTokens("awsConnectorTokens", connector_id=aws_connector.id)
    
    package main
    
    import (
    	"github.com/Twingate/pulumi-twingate/sdk/v3/go/twingate"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		awsNetwork, err := twingate.NewTwingateRemoteNetwork(ctx, "awsNetwork", nil)
    		if err != nil {
    			return err
    		}
    		awsConnector, err := twingate.NewTwingateConnector(ctx, "awsConnector", &twingate.TwingateConnectorArgs{
    			RemoteNetworkId: awsNetwork.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = twingate.NewTwingateConnectorTokens(ctx, "awsConnectorTokens", &twingate.TwingateConnectorTokensArgs{
    			ConnectorId: awsConnector.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Twingate = Twingate.Twingate;
    
    return await Deployment.RunAsync(() => 
    {
        var awsNetwork = new Twingate.TwingateRemoteNetwork("awsNetwork");
    
        var awsConnector = new Twingate.TwingateConnector("awsConnector", new()
        {
            RemoteNetworkId = awsNetwork.Id,
        });
    
        var awsConnectorTokens = new Twingate.TwingateConnectorTokens("awsConnectorTokens", new()
        {
            ConnectorId = awsConnector.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.twingate.TwingateRemoteNetwork;
    import com.pulumi.twingate.TwingateConnector;
    import com.pulumi.twingate.TwingateConnectorArgs;
    import com.pulumi.twingate.TwingateConnectorTokens;
    import com.pulumi.twingate.TwingateConnectorTokensArgs;
    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 awsNetwork = new TwingateRemoteNetwork("awsNetwork");
    
            var awsConnector = new TwingateConnector("awsConnector", TwingateConnectorArgs.builder()
                .remoteNetworkId(awsNetwork.id())
                .build());
    
            var awsConnectorTokens = new TwingateConnectorTokens("awsConnectorTokens", TwingateConnectorTokensArgs.builder()
                .connectorId(awsConnector.id())
                .build());
    
        }
    }
    
    resources:
      awsNetwork:
        type: twingate:TwingateRemoteNetwork
      awsConnector:
        type: twingate:TwingateConnector
        properties:
          remoteNetworkId: ${awsNetwork.id}
      awsConnectorTokens:
        type: twingate:TwingateConnectorTokens
        properties:
          connectorId: ${awsConnector.id}
    

    Create TwingateConnectorTokens Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new TwingateConnectorTokens(name: string, args: TwingateConnectorTokensArgs, opts?: CustomResourceOptions);
    @overload
    def TwingateConnectorTokens(resource_name: str,
                                args: TwingateConnectorTokensArgs,
                                opts: Optional[ResourceOptions] = None)
    
    @overload
    def TwingateConnectorTokens(resource_name: str,
                                opts: Optional[ResourceOptions] = None,
                                connector_id: Optional[str] = None,
                                keepers: Optional[Mapping[str, str]] = None)
    func NewTwingateConnectorTokens(ctx *Context, name string, args TwingateConnectorTokensArgs, opts ...ResourceOption) (*TwingateConnectorTokens, error)
    public TwingateConnectorTokens(string name, TwingateConnectorTokensArgs args, CustomResourceOptions? opts = null)
    public TwingateConnectorTokens(String name, TwingateConnectorTokensArgs args)
    public TwingateConnectorTokens(String name, TwingateConnectorTokensArgs args, CustomResourceOptions options)
    
    type: twingate:TwingateConnectorTokens
    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 TwingateConnectorTokensArgs
    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 TwingateConnectorTokensArgs
    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 TwingateConnectorTokensArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TwingateConnectorTokensArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TwingateConnectorTokensArgs
    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 twingateConnectorTokensResource = new Twingate.TwingateConnectorTokens("twingateConnectorTokensResource", new()
    {
        ConnectorId = "string",
        Keepers = 
        {
            { "string", "string" },
        },
    });
    
    example, err := twingate.NewTwingateConnectorTokens(ctx, "twingateConnectorTokensResource", &twingate.TwingateConnectorTokensArgs{
    	ConnectorId: pulumi.String("string"),
    	Keepers: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    })
    
    var twingateConnectorTokensResource = new TwingateConnectorTokens("twingateConnectorTokensResource", TwingateConnectorTokensArgs.builder()
        .connectorId("string")
        .keepers(Map.of("string", "string"))
        .build());
    
    twingate_connector_tokens_resource = twingate.TwingateConnectorTokens("twingateConnectorTokensResource",
        connector_id="string",
        keepers={
            "string": "string",
        })
    
    const twingateConnectorTokensResource = new twingate.TwingateConnectorTokens("twingateConnectorTokensResource", {
        connectorId: "string",
        keepers: {
            string: "string",
        },
    });
    
    type: twingate:TwingateConnectorTokens
    properties:
        connectorId: string
        keepers:
            string: string
    

    TwingateConnectorTokens 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 TwingateConnectorTokens resource accepts the following input properties:

    ConnectorId string
    The ID of the parent Connector
    Keepers Dictionary<string, string>
    Arbitrary map of values that, when changed, will trigger recreation of resource. Use this to automatically rotate Connector tokens on a schedule.
    ConnectorId string
    The ID of the parent Connector
    Keepers map[string]string
    Arbitrary map of values that, when changed, will trigger recreation of resource. Use this to automatically rotate Connector tokens on a schedule.
    connectorId String
    The ID of the parent Connector
    keepers Map<String,String>
    Arbitrary map of values that, when changed, will trigger recreation of resource. Use this to automatically rotate Connector tokens on a schedule.
    connectorId string
    The ID of the parent Connector
    keepers {[key: string]: string}
    Arbitrary map of values that, when changed, will trigger recreation of resource. Use this to automatically rotate Connector tokens on a schedule.
    connector_id str
    The ID of the parent Connector
    keepers Mapping[str, str]
    Arbitrary map of values that, when changed, will trigger recreation of resource. Use this to automatically rotate Connector tokens on a schedule.
    connectorId String
    The ID of the parent Connector
    keepers Map<String>
    Arbitrary map of values that, when changed, will trigger recreation of resource. Use this to automatically rotate Connector tokens on a schedule.

    Outputs

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

    AccessToken string
    The Access Token of the parent Connector
    Id string
    The provider-assigned unique ID for this managed resource.
    RefreshToken string
    The Refresh Token of the parent Connector
    AccessToken string
    The Access Token of the parent Connector
    Id string
    The provider-assigned unique ID for this managed resource.
    RefreshToken string
    The Refresh Token of the parent Connector
    accessToken String
    The Access Token of the parent Connector
    id String
    The provider-assigned unique ID for this managed resource.
    refreshToken String
    The Refresh Token of the parent Connector
    accessToken string
    The Access Token of the parent Connector
    id string
    The provider-assigned unique ID for this managed resource.
    refreshToken string
    The Refresh Token of the parent Connector
    access_token str
    The Access Token of the parent Connector
    id str
    The provider-assigned unique ID for this managed resource.
    refresh_token str
    The Refresh Token of the parent Connector
    accessToken String
    The Access Token of the parent Connector
    id String
    The provider-assigned unique ID for this managed resource.
    refreshToken String
    The Refresh Token of the parent Connector

    Look up Existing TwingateConnectorTokens Resource

    Get an existing TwingateConnectorTokens 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?: TwingateConnectorTokensState, opts?: CustomResourceOptions): TwingateConnectorTokens
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            access_token: Optional[str] = None,
            connector_id: Optional[str] = None,
            keepers: Optional[Mapping[str, str]] = None,
            refresh_token: Optional[str] = None) -> TwingateConnectorTokens
    func GetTwingateConnectorTokens(ctx *Context, name string, id IDInput, state *TwingateConnectorTokensState, opts ...ResourceOption) (*TwingateConnectorTokens, error)
    public static TwingateConnectorTokens Get(string name, Input<string> id, TwingateConnectorTokensState? state, CustomResourceOptions? opts = null)
    public static TwingateConnectorTokens get(String name, Output<String> id, TwingateConnectorTokensState 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:
    AccessToken string
    The Access Token of the parent Connector
    ConnectorId string
    The ID of the parent Connector
    Keepers Dictionary<string, string>
    Arbitrary map of values that, when changed, will trigger recreation of resource. Use this to automatically rotate Connector tokens on a schedule.
    RefreshToken string
    The Refresh Token of the parent Connector
    AccessToken string
    The Access Token of the parent Connector
    ConnectorId string
    The ID of the parent Connector
    Keepers map[string]string
    Arbitrary map of values that, when changed, will trigger recreation of resource. Use this to automatically rotate Connector tokens on a schedule.
    RefreshToken string
    The Refresh Token of the parent Connector
    accessToken String
    The Access Token of the parent Connector
    connectorId String
    The ID of the parent Connector
    keepers Map<String,String>
    Arbitrary map of values that, when changed, will trigger recreation of resource. Use this to automatically rotate Connector tokens on a schedule.
    refreshToken String
    The Refresh Token of the parent Connector
    accessToken string
    The Access Token of the parent Connector
    connectorId string
    The ID of the parent Connector
    keepers {[key: string]: string}
    Arbitrary map of values that, when changed, will trigger recreation of resource. Use this to automatically rotate Connector tokens on a schedule.
    refreshToken string
    The Refresh Token of the parent Connector
    access_token str
    The Access Token of the parent Connector
    connector_id str
    The ID of the parent Connector
    keepers Mapping[str, str]
    Arbitrary map of values that, when changed, will trigger recreation of resource. Use this to automatically rotate Connector tokens on a schedule.
    refresh_token str
    The Refresh Token of the parent Connector
    accessToken String
    The Access Token of the parent Connector
    connectorId String
    The ID of the parent Connector
    keepers Map<String>
    Arbitrary map of values that, when changed, will trigger recreation of resource. Use this to automatically rotate Connector tokens on a schedule.
    refreshToken String
    The Refresh Token of the parent Connector

    Package Details

    Repository
    twingate Twingate/pulumi-twingate
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the twingate Terraform Provider.
    twingate logo
    Twingate v3.0.12 published on Tuesday, Nov 5, 2024 by Twingate