1. Packages
  2. Twingate
  3. API Docs
  4. getTwingateResources
Twingate v3.0.18 published on Wednesday, Apr 16, 2025 by Twingate

twingate.getTwingateResources

Explore with Pulumi AI

twingate logo
Twingate v3.0.18 published on Wednesday, Apr 16, 2025 by Twingate

    Resources in Twingate represent servers on the private network that clients can connect to. Resources can be defined by IP, CIDR range, FQDN, or DNS zone. For more information, see the Twingate documentation.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as twingate from "@pulumi/twingate";
    
    const foo = twingate.getTwingateResources({
        name: "<your resource's name>",
    });
    
    import pulumi
    import pulumi_twingate as twingate
    
    foo = twingate.get_twingate_resources(name="<your resource's name>")
    
    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 {
    		_, err := twingate.GetTwingateResources(ctx, &twingate.GetTwingateResourcesArgs{
    			Name: pulumi.StringRef("<your resource's name>"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Twingate = Pulumi.Twingate;
    
    return await Deployment.RunAsync(() => 
    {
        var foo = Twingate.GetTwingateResources.Invoke(new()
        {
            Name = "<your resource's name>",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.twingate.TwingateFunctions;
    import com.pulumi.twingate.inputs.GetTwingateResourcesArgs;
    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) {
            final var foo = TwingateFunctions.getTwingateResources(GetTwingateResourcesArgs.builder()
                .name("<your resource's name>")
                .build());
    
        }
    }
    
    variables:
      foo:
        fn::invoke:
          function: twingate:getTwingateResources
          arguments:
            name: <your resource's name>
    

    Using getTwingateResources

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getTwingateResources(args: GetTwingateResourcesArgs, opts?: InvokeOptions): Promise<GetTwingateResourcesResult>
    function getTwingateResourcesOutput(args: GetTwingateResourcesOutputArgs, opts?: InvokeOptions): Output<GetTwingateResourcesResult>
    def get_twingate_resources(name: Optional[str] = None,
                               name_contains: Optional[str] = None,
                               name_exclude: Optional[str] = None,
                               name_prefix: Optional[str] = None,
                               name_regexp: Optional[str] = None,
                               name_suffix: Optional[str] = None,
                               tags: Optional[Mapping[str, str]] = None,
                               opts: Optional[InvokeOptions] = None) -> GetTwingateResourcesResult
    def get_twingate_resources_output(name: Optional[pulumi.Input[str]] = None,
                               name_contains: Optional[pulumi.Input[str]] = None,
                               name_exclude: Optional[pulumi.Input[str]] = None,
                               name_prefix: Optional[pulumi.Input[str]] = None,
                               name_regexp: Optional[pulumi.Input[str]] = None,
                               name_suffix: Optional[pulumi.Input[str]] = None,
                               tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                               opts: Optional[InvokeOptions] = None) -> Output[GetTwingateResourcesResult]
    func GetTwingateResources(ctx *Context, args *GetTwingateResourcesArgs, opts ...InvokeOption) (*GetTwingateResourcesResult, error)
    func GetTwingateResourcesOutput(ctx *Context, args *GetTwingateResourcesOutputArgs, opts ...InvokeOption) GetTwingateResourcesResultOutput

    > Note: This function is named GetTwingateResources in the Go SDK.

    public static class GetTwingateResources 
    {
        public static Task<GetTwingateResourcesResult> InvokeAsync(GetTwingateResourcesArgs args, InvokeOptions? opts = null)
        public static Output<GetTwingateResourcesResult> Invoke(GetTwingateResourcesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetTwingateResourcesResult> getTwingateResources(GetTwingateResourcesArgs args, InvokeOptions options)
    public static Output<GetTwingateResourcesResult> getTwingateResources(GetTwingateResourcesArgs args, InvokeOptions options)
    
    fn::invoke:
      function: twingate:index/getTwingateResources:getTwingateResources
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    Returns only resources that exactly match this name. If no options are passed it will return all resources. Only one option can be used at a time.
    NameContains string
    Match when the value exist in the name of the resource.
    NameExclude string
    Match when the exact value does not exist in the name of the resource.
    NamePrefix string
    The name of the resource must start with the value.
    NameRegexp string
    The regular expression match of the name of the resource.
    NameSuffix string
    The name of the resource must end with the value.
    Tags Dictionary<string, string>
    Returns only resources that exactly match the given tags.
    Name string
    Returns only resources that exactly match this name. If no options are passed it will return all resources. Only one option can be used at a time.
    NameContains string
    Match when the value exist in the name of the resource.
    NameExclude string
    Match when the exact value does not exist in the name of the resource.
    NamePrefix string
    The name of the resource must start with the value.
    NameRegexp string
    The regular expression match of the name of the resource.
    NameSuffix string
    The name of the resource must end with the value.
    Tags map[string]string
    Returns only resources that exactly match the given tags.
    name String
    Returns only resources that exactly match this name. If no options are passed it will return all resources. Only one option can be used at a time.
    nameContains String
    Match when the value exist in the name of the resource.
    nameExclude String
    Match when the exact value does not exist in the name of the resource.
    namePrefix String
    The name of the resource must start with the value.
    nameRegexp String
    The regular expression match of the name of the resource.
    nameSuffix String
    The name of the resource must end with the value.
    tags Map<String,String>
    Returns only resources that exactly match the given tags.
    name string
    Returns only resources that exactly match this name. If no options are passed it will return all resources. Only one option can be used at a time.
    nameContains string
    Match when the value exist in the name of the resource.
    nameExclude string
    Match when the exact value does not exist in the name of the resource.
    namePrefix string
    The name of the resource must start with the value.
    nameRegexp string
    The regular expression match of the name of the resource.
    nameSuffix string
    The name of the resource must end with the value.
    tags {[key: string]: string}
    Returns only resources that exactly match the given tags.
    name str
    Returns only resources that exactly match this name. If no options are passed it will return all resources. Only one option can be used at a time.
    name_contains str
    Match when the value exist in the name of the resource.
    name_exclude str
    Match when the exact value does not exist in the name of the resource.
    name_prefix str
    The name of the resource must start with the value.
    name_regexp str
    The regular expression match of the name of the resource.
    name_suffix str
    The name of the resource must end with the value.
    tags Mapping[str, str]
    Returns only resources that exactly match the given tags.
    name String
    Returns only resources that exactly match this name. If no options are passed it will return all resources. Only one option can be used at a time.
    nameContains String
    Match when the value exist in the name of the resource.
    nameExclude String
    Match when the exact value does not exist in the name of the resource.
    namePrefix String
    The name of the resource must start with the value.
    nameRegexp String
    The regular expression match of the name of the resource.
    nameSuffix String
    The name of the resource must end with the value.
    tags Map<String>
    Returns only resources that exactly match the given tags.

    getTwingateResources Result

    The following output properties are available:

    Id string
    The ID of this resource.
    Resources List<Twingate.Twingate.Outputs.GetTwingateResourcesResource>
    List of Resources
    Name string
    Returns only resources that exactly match this name. If no options are passed it will return all resources. Only one option can be used at a time.
    NameContains string
    Match when the value exist in the name of the resource.
    NameExclude string
    Match when the exact value does not exist in the name of the resource.
    NamePrefix string
    The name of the resource must start with the value.
    NameRegexp string
    The regular expression match of the name of the resource.
    NameSuffix string
    The name of the resource must end with the value.
    Tags Dictionary<string, string>
    Returns only resources that exactly match the given tags.
    Id string
    The ID of this resource.
    Resources []GetTwingateResourcesResource
    List of Resources
    Name string
    Returns only resources that exactly match this name. If no options are passed it will return all resources. Only one option can be used at a time.
    NameContains string
    Match when the value exist in the name of the resource.
    NameExclude string
    Match when the exact value does not exist in the name of the resource.
    NamePrefix string
    The name of the resource must start with the value.
    NameRegexp string
    The regular expression match of the name of the resource.
    NameSuffix string
    The name of the resource must end with the value.
    Tags map[string]string
    Returns only resources that exactly match the given tags.
    id String
    The ID of this resource.
    resources List<GetTwingateResourcesResource>
    List of Resources
    name String
    Returns only resources that exactly match this name. If no options are passed it will return all resources. Only one option can be used at a time.
    nameContains String
    Match when the value exist in the name of the resource.
    nameExclude String
    Match when the exact value does not exist in the name of the resource.
    namePrefix String
    The name of the resource must start with the value.
    nameRegexp String
    The regular expression match of the name of the resource.
    nameSuffix String
    The name of the resource must end with the value.
    tags Map<String,String>
    Returns only resources that exactly match the given tags.
    id string
    The ID of this resource.
    resources GetTwingateResourcesResource[]
    List of Resources
    name string
    Returns only resources that exactly match this name. If no options are passed it will return all resources. Only one option can be used at a time.
    nameContains string
    Match when the value exist in the name of the resource.
    nameExclude string
    Match when the exact value does not exist in the name of the resource.
    namePrefix string
    The name of the resource must start with the value.
    nameRegexp string
    The regular expression match of the name of the resource.
    nameSuffix string
    The name of the resource must end with the value.
    tags {[key: string]: string}
    Returns only resources that exactly match the given tags.
    id str
    The ID of this resource.
    resources Sequence[GetTwingateResourcesResource]
    List of Resources
    name str
    Returns only resources that exactly match this name. If no options are passed it will return all resources. Only one option can be used at a time.
    name_contains str
    Match when the value exist in the name of the resource.
    name_exclude str
    Match when the exact value does not exist in the name of the resource.
    name_prefix str
    The name of the resource must start with the value.
    name_regexp str
    The regular expression match of the name of the resource.
    name_suffix str
    The name of the resource must end with the value.
    tags Mapping[str, str]
    Returns only resources that exactly match the given tags.
    id String
    The ID of this resource.
    resources List<Property Map>
    List of Resources
    name String
    Returns only resources that exactly match this name. If no options are passed it will return all resources. Only one option can be used at a time.
    nameContains String
    Match when the value exist in the name of the resource.
    nameExclude String
    Match when the exact value does not exist in the name of the resource.
    namePrefix String
    The name of the resource must start with the value.
    nameRegexp String
    The regular expression match of the name of the resource.
    nameSuffix String
    The name of the resource must end with the value.
    tags Map<String>
    Returns only resources that exactly match the given tags.

    Supporting Types

    GetTwingateResourcesResource

    Address string
    The Resource's IP/CIDR or FQDN/DNS zone
    Id string
    The id of the Resource
    Name string
    The name of the Resource
    Protocols Twingate.Twingate.Inputs.GetTwingateResourcesResourceProtocols
    Restrict access to certain protocols and ports. By default or when this argument is not defined, there is no restriction, and all protocols and ports are allowed.
    RemoteNetworkId string
    Remote Network ID where the Resource lives
    Tags Dictionary<string, string>
    The tags attribute consists of a key-value pairs that correspond with tags to be set on the resource.
    Address string
    The Resource's IP/CIDR or FQDN/DNS zone
    Id string
    The id of the Resource
    Name string
    The name of the Resource
    Protocols GetTwingateResourcesResourceProtocols
    Restrict access to certain protocols and ports. By default or when this argument is not defined, there is no restriction, and all protocols and ports are allowed.
    RemoteNetworkId string
    Remote Network ID where the Resource lives
    Tags map[string]string
    The tags attribute consists of a key-value pairs that correspond with tags to be set on the resource.
    address String
    The Resource's IP/CIDR or FQDN/DNS zone
    id String
    The id of the Resource
    name String
    The name of the Resource
    protocols GetTwingateResourcesResourceProtocols
    Restrict access to certain protocols and ports. By default or when this argument is not defined, there is no restriction, and all protocols and ports are allowed.
    remoteNetworkId String
    Remote Network ID where the Resource lives
    tags Map<String,String>
    The tags attribute consists of a key-value pairs that correspond with tags to be set on the resource.
    address string
    The Resource's IP/CIDR or FQDN/DNS zone
    id string
    The id of the Resource
    name string
    The name of the Resource
    protocols GetTwingateResourcesResourceProtocols
    Restrict access to certain protocols and ports. By default or when this argument is not defined, there is no restriction, and all protocols and ports are allowed.
    remoteNetworkId string
    Remote Network ID where the Resource lives
    tags {[key: string]: string}
    The tags attribute consists of a key-value pairs that correspond with tags to be set on the resource.
    address str
    The Resource's IP/CIDR or FQDN/DNS zone
    id str
    The id of the Resource
    name str
    The name of the Resource
    protocols GetTwingateResourcesResourceProtocols
    Restrict access to certain protocols and ports. By default or when this argument is not defined, there is no restriction, and all protocols and ports are allowed.
    remote_network_id str
    Remote Network ID where the Resource lives
    tags Mapping[str, str]
    The tags attribute consists of a key-value pairs that correspond with tags to be set on the resource.
    address String
    The Resource's IP/CIDR or FQDN/DNS zone
    id String
    The id of the Resource
    name String
    The name of the Resource
    protocols Property Map
    Restrict access to certain protocols and ports. By default or when this argument is not defined, there is no restriction, and all protocols and ports are allowed.
    remoteNetworkId String
    Remote Network ID where the Resource lives
    tags Map<String>
    The tags attribute consists of a key-value pairs that correspond with tags to be set on the resource.

    GetTwingateResourcesResourceProtocols

    allowIcmp Boolean
    Whether to allow ICMP (ping) traffic
    tcp Property Map
    udp Property Map

    GetTwingateResourcesResourceProtocolsTcp

    Policy string
    Whether to allow or deny all ports, or restrict protocol access within certain port ranges: Can be RESTRICTED (only listed ports are allowed), ALLOW_ALL, or DENY_ALL
    Ports List<string>
    List of port ranges between 1 and 65535 inclusive, in the format 100-200 for a range, or 8080 for a single port
    Policy string
    Whether to allow or deny all ports, or restrict protocol access within certain port ranges: Can be RESTRICTED (only listed ports are allowed), ALLOW_ALL, or DENY_ALL
    Ports []string
    List of port ranges between 1 and 65535 inclusive, in the format 100-200 for a range, or 8080 for a single port
    policy String
    Whether to allow or deny all ports, or restrict protocol access within certain port ranges: Can be RESTRICTED (only listed ports are allowed), ALLOW_ALL, or DENY_ALL
    ports List<String>
    List of port ranges between 1 and 65535 inclusive, in the format 100-200 for a range, or 8080 for a single port
    policy string
    Whether to allow or deny all ports, or restrict protocol access within certain port ranges: Can be RESTRICTED (only listed ports are allowed), ALLOW_ALL, or DENY_ALL
    ports string[]
    List of port ranges between 1 and 65535 inclusive, in the format 100-200 for a range, or 8080 for a single port
    policy str
    Whether to allow or deny all ports, or restrict protocol access within certain port ranges: Can be RESTRICTED (only listed ports are allowed), ALLOW_ALL, or DENY_ALL
    ports Sequence[str]
    List of port ranges between 1 and 65535 inclusive, in the format 100-200 for a range, or 8080 for a single port
    policy String
    Whether to allow or deny all ports, or restrict protocol access within certain port ranges: Can be RESTRICTED (only listed ports are allowed), ALLOW_ALL, or DENY_ALL
    ports List<String>
    List of port ranges between 1 and 65535 inclusive, in the format 100-200 for a range, or 8080 for a single port

    GetTwingateResourcesResourceProtocolsUdp

    Policy string
    Whether to allow or deny all ports, or restrict protocol access within certain port ranges: Can be RESTRICTED (only listed ports are allowed), ALLOW_ALL, or DENY_ALL
    Ports List<string>
    List of port ranges between 1 and 65535 inclusive, in the format 100-200 for a range, or 8080 for a single port
    Policy string
    Whether to allow or deny all ports, or restrict protocol access within certain port ranges: Can be RESTRICTED (only listed ports are allowed), ALLOW_ALL, or DENY_ALL
    Ports []string
    List of port ranges between 1 and 65535 inclusive, in the format 100-200 for a range, or 8080 for a single port
    policy String
    Whether to allow or deny all ports, or restrict protocol access within certain port ranges: Can be RESTRICTED (only listed ports are allowed), ALLOW_ALL, or DENY_ALL
    ports List<String>
    List of port ranges between 1 and 65535 inclusive, in the format 100-200 for a range, or 8080 for a single port
    policy string
    Whether to allow or deny all ports, or restrict protocol access within certain port ranges: Can be RESTRICTED (only listed ports are allowed), ALLOW_ALL, or DENY_ALL
    ports string[]
    List of port ranges between 1 and 65535 inclusive, in the format 100-200 for a range, or 8080 for a single port
    policy str
    Whether to allow or deny all ports, or restrict protocol access within certain port ranges: Can be RESTRICTED (only listed ports are allowed), ALLOW_ALL, or DENY_ALL
    ports Sequence[str]
    List of port ranges between 1 and 65535 inclusive, in the format 100-200 for a range, or 8080 for a single port
    policy String
    Whether to allow or deny all ports, or restrict protocol access within certain port ranges: Can be RESTRICTED (only listed ports are allowed), ALLOW_ALL, or DENY_ALL
    ports List<String>
    List of port ranges between 1 and 65535 inclusive, in the format 100-200 for a range, or 8080 for a single port

    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.18 published on Wednesday, Apr 16, 2025 by Twingate