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

twingate.getTwingateResources

Explore with Pulumi AI

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>",
});
Copy
import pulumi
import pulumi_twingate as twingate

foo = twingate.get_twingate_resources(name="<your resource's name>")
Copy
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
	})
}
Copy
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>",
    });

});
Copy
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());

    }
}
Copy
variables:
  foo:
    fn::invoke:
      function: twingate:getTwingateResources
      arguments:
        name: <your resource's name>
Copy

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>
Copy
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]
Copy
func GetTwingateResources(ctx *Context, args *GetTwingateResourcesArgs, opts ...InvokeOption) (*GetTwingateResourcesResult, error)
func GetTwingateResourcesOutput(ctx *Context, args *GetTwingateResourcesOutputArgs, opts ...InvokeOption) GetTwingateResourcesResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetTwingateResourcesResult> getTwingateResources(GetTwingateResourcesArgs args, InvokeOptions options)
public static Output<GetTwingateResourcesResult> getTwingateResources(GetTwingateResourcesArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: twingate:index/getTwingateResources:getTwingateResources
  arguments:
    # arguments dictionary
Copy

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 This property is required. string
The Resource's IP/CIDR or FQDN/DNS zone
Id This property is required. string
The id of the Resource
Name This property is required. string
The name of the Resource
Protocols This property is required. 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 This property is required. string
Remote Network ID where the Resource lives
Tags This property is required. Dictionary<string, string>
The tags attribute consists of a key-value pairs that correspond with tags to be set on the resource.
Address This property is required. string
The Resource's IP/CIDR or FQDN/DNS zone
Id This property is required. string
The id of the Resource
Name This property is required. string
The name of the Resource
Protocols This property is required. 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 This property is required. string
Remote Network ID where the Resource lives
Tags This property is required. map[string]string
The tags attribute consists of a key-value pairs that correspond with tags to be set on the resource.
address This property is required. String
The Resource's IP/CIDR or FQDN/DNS zone
id This property is required. String
The id of the Resource
name This property is required. String
The name of the Resource
protocols This property is required. 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 This property is required. String
Remote Network ID where the Resource lives
tags This property is required. Map<String,String>
The tags attribute consists of a key-value pairs that correspond with tags to be set on the resource.
address This property is required. string
The Resource's IP/CIDR or FQDN/DNS zone
id This property is required. string
The id of the Resource
name This property is required. string
The name of the Resource
protocols This property is required. 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 This property is required. string
Remote Network ID where the Resource lives
tags This property is required. {[key: string]: string}
The tags attribute consists of a key-value pairs that correspond with tags to be set on the resource.
address This property is required. str
The Resource's IP/CIDR or FQDN/DNS zone
id This property is required. str
The id of the Resource
name This property is required. str
The name of the Resource
protocols This property is required. 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 This property is required. str
Remote Network ID where the Resource lives
tags This property is required. Mapping[str, str]
The tags attribute consists of a key-value pairs that correspond with tags to be set on the resource.
address This property is required. String
The Resource's IP/CIDR or FQDN/DNS zone
id This property is required. String
The id of the Resource
name This property is required. String
The name of the Resource
protocols This property is required. 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 This property is required. String
Remote Network ID where the Resource lives
tags This property is required. Map<String>
The tags attribute consists of a key-value pairs that correspond with tags to be set on the resource.

GetTwingateResourcesResourceProtocols

AllowIcmp This property is required. bool
Whether to allow ICMP (ping) traffic
Tcp This property is required. Twingate.Twingate.Inputs.GetTwingateResourcesResourceProtocolsTcp
Udp This property is required. Twingate.Twingate.Inputs.GetTwingateResourcesResourceProtocolsUdp
AllowIcmp This property is required. bool
Whether to allow ICMP (ping) traffic
Tcp This property is required. GetTwingateResourcesResourceProtocolsTcp
Udp This property is required. GetTwingateResourcesResourceProtocolsUdp
allowIcmp This property is required. Boolean
Whether to allow ICMP (ping) traffic
tcp This property is required. GetTwingateResourcesResourceProtocolsTcp
udp This property is required. GetTwingateResourcesResourceProtocolsUdp
allowIcmp This property is required. boolean
Whether to allow ICMP (ping) traffic
tcp This property is required. GetTwingateResourcesResourceProtocolsTcp
udp This property is required. GetTwingateResourcesResourceProtocolsUdp
allow_icmp This property is required. bool
Whether to allow ICMP (ping) traffic
tcp This property is required. GetTwingateResourcesResourceProtocolsTcp
udp This property is required. GetTwingateResourcesResourceProtocolsUdp
allowIcmp This property is required. Boolean
Whether to allow ICMP (ping) traffic
tcp This property is required. Property Map
udp This property is required. Property Map

GetTwingateResourcesResourceProtocolsTcp

Policy This property is required. 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 This property is required. 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 This property is required. 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 This property is required. []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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. []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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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.