1. Packages
  2. Twingate
  3. API Docs
  4. getTwingateResource
Twingate v3.0.1 published on Friday, Apr 19, 2024 by Twingate

twingate.getTwingateResource

Explore with Pulumi AI

twingate logo
Twingate v3.0.1 published on Friday, Apr 19, 2024 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>",
    });
    
    import pulumi
    import pulumi_twingate as twingate
    
    foo = twingate.get_twingate_resource(id="<your resource's 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 {
    		_, err := twingate.LookupTwingateResource(ctx, &twingate.LookupTwingateResourceArgs{
    			Id: "<your resource's id>",
    		}, 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.GetTwingateResource.Invoke(new()
        {
            Id = "<your resource's id>",
        });
    
    });
    
    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());
    
        }
    }
    
    variables:
      foo:
        fn::invoke:
          Function: twingate:getTwingateResource
          Arguments:
            id: <your resource's id>
    

    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>
    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]
    func LookupTwingateResource(ctx *Context, args *LookupTwingateResourceArgs, opts ...InvokeOption) (*LookupTwingateResourceResult, error)
    func LookupTwingateResourceOutput(ctx *Context, args *LookupTwingateResourceOutputArgs, opts ...InvokeOption) LookupTwingateResourceResultOutput

    > 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)
    }
    public static CompletableFuture<GetTwingateResourceResult> getTwingateResource(GetTwingateResourceArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: twingate:index/getTwingateResource:getTwingateResource
      arguments:
        # arguments dictionary

    The following arguments are supported:

    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.
    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 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 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 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 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 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.
    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.
    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.
    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.
    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.
    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.
    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 Boolean
    Whether to allow ICMP (ping) traffic
    tcp Property Map
    udp Property Map

    GetTwingateResourceProtocolsTcp

    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

    GetTwingateResourceProtocolsUdp

    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.1 published on Friday, Apr 19, 2024 by Twingate