1. Packages
  2. CockroachDB Cloud
  3. API Docs
  4. getFolder
CockroachDB v0.6.0 published on Friday, Nov 1, 2024 by pulumiverse

cockroach.getFolder

Explore with Pulumi AI

cockroach logo
CockroachDB v0.6.0 published on Friday, Nov 1, 2024 by pulumiverse

    A CockroachDB Cloud folder. Folders can contain clusters or other folders. They can be used to group resources together for the purposes of access control, organization or fine grained invoicing.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as cockroach from "@pulumi/cockroach";
    
    const config = new pulumi.Config();
    const prodFolderId = config.require("prodFolderId");
    const team1 = cockroach.getFolder({
        path: "/prod/team1",
    });
    const prod = cockroach.getFolder({
        id: prodFolderId,
    });
    
    import pulumi
    import pulumi_cockroach as cockroach
    
    config = pulumi.Config()
    prod_folder_id = config.require("prodFolderId")
    team1 = cockroach.get_folder(path="/prod/team1")
    prod = cockroach.get_folder(id=prod_folder_id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    	"github.com/pulumiverse/pulumi-cockroach/sdk/go/cockroach"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		prodFolderId := cfg.Require("prodFolderId")
    		_, err := cockroach.LookupFolder(ctx, &cockroach.LookupFolderArgs{
    			Path: pulumi.StringRef("/prod/team1"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = cockroach.LookupFolder(ctx, &cockroach.LookupFolderArgs{
    			Id: pulumi.StringRef(prodFolderId),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Cockroach = Pulumi.Cockroach;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var prodFolderId = config.Require("prodFolderId");
        var team1 = Cockroach.GetFolder.Invoke(new()
        {
            Path = "/prod/team1",
        });
    
        var prod = Cockroach.GetFolder.Invoke(new()
        {
            Id = prodFolderId,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.cockroach.CockroachFunctions;
    import com.pulumi.cockroach.inputs.GetFolderArgs;
    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 config = ctx.config();
            final var prodFolderId = config.get("prodFolderId");
            final var team1 = CockroachFunctions.getFolder(GetFolderArgs.builder()
                .path("/prod/team1")
                .build());
    
            final var prod = CockroachFunctions.getFolder(GetFolderArgs.builder()
                .id(prodFolderId)
                .build());
    
        }
    }
    
    configuration:
      prodFolderId:
        type: string
    variables:
      team1:
        fn::invoke:
          Function: cockroach:getFolder
          Arguments:
            path: /prod/team1
      prod:
        fn::invoke:
          Function: cockroach:getFolder
          Arguments:
            id: ${prodFolderId}
    

    Using getFolder

    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 getFolder(args: GetFolderArgs, opts?: InvokeOptions): Promise<GetFolderResult>
    function getFolderOutput(args: GetFolderOutputArgs, opts?: InvokeOptions): Output<GetFolderResult>
    def get_folder(id: Optional[str] = None,
                   path: Optional[str] = None,
                   opts: Optional[InvokeOptions] = None) -> GetFolderResult
    def get_folder_output(id: Optional[pulumi.Input[str]] = None,
                   path: Optional[pulumi.Input[str]] = None,
                   opts: Optional[InvokeOptions] = None) -> Output[GetFolderResult]
    func LookupFolder(ctx *Context, args *LookupFolderArgs, opts ...InvokeOption) (*LookupFolderResult, error)
    func LookupFolderOutput(ctx *Context, args *LookupFolderOutputArgs, opts ...InvokeOption) LookupFolderResultOutput

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

    public static class GetFolder 
    {
        public static Task<GetFolderResult> InvokeAsync(GetFolderArgs args, InvokeOptions? opts = null)
        public static Output<GetFolderResult> Invoke(GetFolderInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetFolderResult> getFolder(GetFolderArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: cockroach:index/getFolder:getFolder
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Id string
    The id the folder.
    Path string
    An absolute path to the folder. Trailing slashes are optional. (i.e. /folder1/folder2)
    Id string
    The id the folder.
    Path string
    An absolute path to the folder. Trailing slashes are optional. (i.e. /folder1/folder2)
    id String
    The id the folder.
    path String
    An absolute path to the folder. Trailing slashes are optional. (i.e. /folder1/folder2)
    id string
    The id the folder.
    path string
    An absolute path to the folder. Trailing slashes are optional. (i.e. /folder1/folder2)
    id str
    The id the folder.
    path str
    An absolute path to the folder. Trailing slashes are optional. (i.e. /folder1/folder2)
    id String
    The id the folder.
    path String
    An absolute path to the folder. Trailing slashes are optional. (i.e. /folder1/folder2)

    getFolder Result

    The following output properties are available:

    Name string
    Name of the folder.
    ParentId string
    The ID of the folders's parent folder. 'root' is used for a folder at the root level.
    Id string
    The id the folder.
    Path string
    An absolute path to the folder. Trailing slashes are optional. (i.e. /folder1/folder2)
    Name string
    Name of the folder.
    ParentId string
    The ID of the folders's parent folder. 'root' is used for a folder at the root level.
    Id string
    The id the folder.
    Path string
    An absolute path to the folder. Trailing slashes are optional. (i.e. /folder1/folder2)
    name String
    Name of the folder.
    parentId String
    The ID of the folders's parent folder. 'root' is used for a folder at the root level.
    id String
    The id the folder.
    path String
    An absolute path to the folder. Trailing slashes are optional. (i.e. /folder1/folder2)
    name string
    Name of the folder.
    parentId string
    The ID of the folders's parent folder. 'root' is used for a folder at the root level.
    id string
    The id the folder.
    path string
    An absolute path to the folder. Trailing slashes are optional. (i.e. /folder1/folder2)
    name str
    Name of the folder.
    parent_id str
    The ID of the folders's parent folder. 'root' is used for a folder at the root level.
    id str
    The id the folder.
    path str
    An absolute path to the folder. Trailing slashes are optional. (i.e. /folder1/folder2)
    name String
    Name of the folder.
    parentId String
    The ID of the folders's parent folder. 'root' is used for a folder at the root level.
    id String
    The id the folder.
    path String
    An absolute path to the folder. Trailing slashes are optional. (i.e. /folder1/folder2)

    Package Details

    Repository
    cockroach pulumiverse/pulumi-cockroach
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the cockroach Terraform Provider.
    cockroach logo
    CockroachDB v0.6.0 published on Friday, Nov 1, 2024 by pulumiverse