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

twingate.getTwingateResource

Explore with Pulumi AI

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

Resources in Twingate represent any network destination address that you wish to provide private access to for users authorized via the Twingate Client application. Resources can be defined by either IP or DNS address, and all private DNS addresses will be automatically resolved with no client configuration changes. For more information, see the Twingate documentation.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as twingate from "@pulumi/twingate";

const foo = twingate.getTwingateResource({
    id: "<your resource's id>",
});
Copy
import pulumi
import pulumi_twingate as twingate

foo = twingate.get_twingate_resource(id="<your resource's id>")
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.LookupTwingateResource(ctx, &twingate.LookupTwingateResourceArgs{
			Id: "<your resource's id>",
		}, 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.GetTwingateResource.Invoke(new()
    {
        Id = "<your resource's id>",
    });

});
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.GetTwingateResourceArgs;
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.getTwingateResource(GetTwingateResourceArgs.builder()
            .id("<your resource's id>")
            .build());

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

Using getTwingateResource

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 getTwingateResource(args: GetTwingateResourceArgs, opts?: InvokeOptions): Promise<GetTwingateResourceResult>
function getTwingateResourceOutput(args: GetTwingateResourceOutputArgs, opts?: InvokeOptions): Output<GetTwingateResourceResult>
Copy
def get_twingate_resource(id: Optional[str] = None,
                          protocols: Optional[GetTwingateResourceProtocols] = None,
                          opts: Optional[InvokeOptions] = None) -> GetTwingateResourceResult
def get_twingate_resource_output(id: Optional[pulumi.Input[str]] = None,
                          protocols: Optional[pulumi.Input[GetTwingateResourceProtocolsArgs]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetTwingateResourceResult]
Copy
func LookupTwingateResource(ctx *Context, args *LookupTwingateResourceArgs, opts ...InvokeOption) (*LookupTwingateResourceResult, error)
func LookupTwingateResourceOutput(ctx *Context, args *LookupTwingateResourceOutputArgs, opts ...InvokeOption) LookupTwingateResourceResultOutput
Copy

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

public static class GetTwingateResource 
{
    public static Task<GetTwingateResourceResult> InvokeAsync(GetTwingateResourceArgs args, InvokeOptions? opts = null)
    public static Output<GetTwingateResourceResult> Invoke(GetTwingateResourceInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetTwingateResourceResult> getTwingateResource(GetTwingateResourceArgs args, InvokeOptions options)
public static Output<GetTwingateResourceResult> getTwingateResource(GetTwingateResourceArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: twingate:index/getTwingateResource:getTwingateResource
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Id This property is required. string
The ID of the Resource. The ID for the Resource can be obtained from the Admin API or the URL string in the Admin Console.
Protocols Twingate.Twingate.Inputs.GetTwingateResourceProtocols
By default (when this argument is not defined) no restriction is applied, and all protocols and ports are allowed.
Id This property is required. string
The ID of the Resource. The ID for the Resource can be obtained from the Admin API or the URL string in the Admin Console.
Protocols GetTwingateResourceProtocols
By default (when this argument is not defined) no restriction is applied, and all protocols and ports are allowed.
id This property is required. String
The ID of the Resource. The ID for the Resource can be obtained from the Admin API or the URL string in the Admin Console.
protocols GetTwingateResourceProtocols
By default (when this argument is not defined) no restriction is applied, and all protocols and ports are allowed.
id This property is required. string
The ID of the Resource. The ID for the Resource can be obtained from the Admin API or the URL string in the Admin Console.
protocols GetTwingateResourceProtocols
By default (when this argument is not defined) no restriction is applied, and all protocols and ports are allowed.
id This property is required. str
The ID of the Resource. The ID for the Resource can be obtained from the Admin API or the URL string in the Admin Console.
protocols GetTwingateResourceProtocols
By default (when this argument is not defined) no restriction is applied, and all protocols and ports are allowed.
id This property is required. String
The ID of the Resource. The ID for the Resource can be obtained from the Admin API or the URL string in the Admin Console.
protocols Property Map
By default (when this argument is not defined) no restriction is applied, and all protocols and ports are allowed.

getTwingateResource Result

The following output properties are available:

Address string
The Resource's address, which may be an IP address, CIDR range, or DNS address
Id string
The ID of the Resource. The ID for the Resource can be obtained from the Admin API or the URL string in the Admin Console.
Name string
The name of the Resource
RemoteNetworkId string
The Remote Network ID that the Resource is associated with. Resources may only be associated with a single Remote Network.
Tags Dictionary<string, string>
The tags attribute consists of a key-value pairs that correspond with tags to be set on the resource.
Protocols Twingate.Twingate.Outputs.GetTwingateResourceProtocols
By default (when this argument is not defined) no restriction is applied, and all protocols and ports are allowed.
Address string
The Resource's address, which may be an IP address, CIDR range, or DNS address
Id string
The ID of the Resource. The ID for the Resource can be obtained from the Admin API or the URL string in the Admin Console.
Name string
The name of the Resource
RemoteNetworkId string
The Remote Network ID that the Resource is associated with. Resources may only be associated with a single Remote Network.
Tags map[string]string
The tags attribute consists of a key-value pairs that correspond with tags to be set on the resource.
Protocols GetTwingateResourceProtocols
By default (when this argument is not defined) no restriction is applied, and all protocols and ports are allowed.
address String
The Resource's address, which may be an IP address, CIDR range, or DNS address
id String
The ID of the Resource. The ID for the Resource can be obtained from the Admin API or the URL string in the Admin Console.
name String
The name of the Resource
remoteNetworkId String
The Remote Network ID that the Resource is associated with. Resources may only be associated with a single Remote Network.
tags Map<String,String>
The tags attribute consists of a key-value pairs that correspond with tags to be set on the resource.
protocols GetTwingateResourceProtocols
By default (when this argument is not defined) no restriction is applied, and all protocols and ports are allowed.
address string
The Resource's address, which may be an IP address, CIDR range, or DNS address
id string
The ID of the Resource. The ID for the Resource can be obtained from the Admin API or the URL string in the Admin Console.
name string
The name of the Resource
remoteNetworkId string
The Remote Network ID that the Resource is associated with. Resources may only be associated with a single Remote Network.
tags {[key: string]: string}
The tags attribute consists of a key-value pairs that correspond with tags to be set on the resource.
protocols GetTwingateResourceProtocols
By default (when this argument is not defined) no restriction is applied, and all protocols and ports are allowed.
address str
The Resource's address, which may be an IP address, CIDR range, or DNS address
id str
The ID of the Resource. The ID for the Resource can be obtained from the Admin API or the URL string in the Admin Console.
name str
The name of the Resource
remote_network_id str
The Remote Network ID that the Resource is associated with. Resources may only be associated with a single Remote Network.
tags Mapping[str, str]
The tags attribute consists of a key-value pairs that correspond with tags to be set on the resource.
protocols GetTwingateResourceProtocols
By default (when this argument is not defined) no restriction is applied, and all protocols and ports are allowed.
address String
The Resource's address, which may be an IP address, CIDR range, or DNS address
id String
The ID of the Resource. The ID for the Resource can be obtained from the Admin API or the URL string in the Admin Console.
name String
The name of the Resource
remoteNetworkId String
The Remote Network ID that the Resource is associated with. Resources may only be associated with a single Remote Network.
tags Map<String>
The tags attribute consists of a key-value pairs that correspond with tags to be set on the resource.
protocols Property Map
By default (when this argument is not defined) no restriction is applied, and all protocols and ports are allowed.

Supporting Types

GetTwingateResourceProtocols

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

GetTwingateResourceProtocolsTcp

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

GetTwingateResourceProtocolsUdp

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