1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. organizations
  5. getActiveFolder
Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi

gcp.organizations.getActiveFolder

Explore with Pulumi AI

gcp logo
Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi

    Get an active folder within GCP by display_name and parent.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const department1 = gcp.organizations.getActiveFolder({
        displayName: "Department 1",
        parent: "organizations/1234567",
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    department1 = gcp.organizations.get_active_folder(display_name="Department 1",
        parent="organizations/1234567")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/organizations"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := organizations.GetActiveFolder(ctx, &organizations.GetActiveFolderArgs{
    			DisplayName: "Department 1",
    			Parent:      "organizations/1234567",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var department1 = Gcp.Organizations.GetActiveFolder.Invoke(new()
        {
            DisplayName = "Department 1",
            Parent = "organizations/1234567",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.organizations.OrganizationsFunctions;
    import com.pulumi.gcp.organizations.inputs.GetActiveFolderArgs;
    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 department1 = OrganizationsFunctions.getActiveFolder(GetActiveFolderArgs.builder()
                .displayName("Department 1")
                .parent("organizations/1234567")
                .build());
    
        }
    }
    
    variables:
      department1:
        fn::invoke:
          Function: gcp:organizations:getActiveFolder
          Arguments:
            displayName: Department 1
            parent: organizations/1234567
    

    Using getActiveFolder

    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 getActiveFolder(args: GetActiveFolderArgs, opts?: InvokeOptions): Promise<GetActiveFolderResult>
    function getActiveFolderOutput(args: GetActiveFolderOutputArgs, opts?: InvokeOptions): Output<GetActiveFolderResult>
    def get_active_folder(api_method: Optional[str] = None,
                          display_name: Optional[str] = None,
                          parent: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetActiveFolderResult
    def get_active_folder_output(api_method: Optional[pulumi.Input[str]] = None,
                          display_name: Optional[pulumi.Input[str]] = None,
                          parent: Optional[pulumi.Input[str]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetActiveFolderResult]
    func GetActiveFolder(ctx *Context, args *GetActiveFolderArgs, opts ...InvokeOption) (*GetActiveFolderResult, error)
    func GetActiveFolderOutput(ctx *Context, args *GetActiveFolderOutputArgs, opts ...InvokeOption) GetActiveFolderResultOutput

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

    public static class GetActiveFolder 
    {
        public static Task<GetActiveFolderResult> InvokeAsync(GetActiveFolderArgs args, InvokeOptions? opts = null)
        public static Output<GetActiveFolderResult> Invoke(GetActiveFolderInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetActiveFolderResult> getActiveFolder(GetActiveFolderArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: gcp:organizations/getActiveFolder:getActiveFolder
      arguments:
        # arguments dictionary

    The following arguments are supported:

    DisplayName string
    The folder's display name.
    Parent string
    The resource name of the parent Folder or Organization.
    ApiMethod string
    The API method to use to search for the folder. Valid values are LIST and SEARCH. Default Value is LIST. LIST is strongly consistent and requires resourcemanager.folders.list on the parent folder, while SEARCH is eventually consistent and only returns folders that the user has resourcemanager.folders.get permission on.
    DisplayName string
    The folder's display name.
    Parent string
    The resource name of the parent Folder or Organization.
    ApiMethod string
    The API method to use to search for the folder. Valid values are LIST and SEARCH. Default Value is LIST. LIST is strongly consistent and requires resourcemanager.folders.list on the parent folder, while SEARCH is eventually consistent and only returns folders that the user has resourcemanager.folders.get permission on.
    displayName String
    The folder's display name.
    parent String
    The resource name of the parent Folder or Organization.
    apiMethod String
    The API method to use to search for the folder. Valid values are LIST and SEARCH. Default Value is LIST. LIST is strongly consistent and requires resourcemanager.folders.list on the parent folder, while SEARCH is eventually consistent and only returns folders that the user has resourcemanager.folders.get permission on.
    displayName string
    The folder's display name.
    parent string
    The resource name of the parent Folder or Organization.
    apiMethod string
    The API method to use to search for the folder. Valid values are LIST and SEARCH. Default Value is LIST. LIST is strongly consistent and requires resourcemanager.folders.list on the parent folder, while SEARCH is eventually consistent and only returns folders that the user has resourcemanager.folders.get permission on.
    display_name str
    The folder's display name.
    parent str
    The resource name of the parent Folder or Organization.
    api_method str
    The API method to use to search for the folder. Valid values are LIST and SEARCH. Default Value is LIST. LIST is strongly consistent and requires resourcemanager.folders.list on the parent folder, while SEARCH is eventually consistent and only returns folders that the user has resourcemanager.folders.get permission on.
    displayName String
    The folder's display name.
    parent String
    The resource name of the parent Folder or Organization.
    apiMethod String
    The API method to use to search for the folder. Valid values are LIST and SEARCH. Default Value is LIST. LIST is strongly consistent and requires resourcemanager.folders.list on the parent folder, while SEARCH is eventually consistent and only returns folders that the user has resourcemanager.folders.get permission on.

    getActiveFolder Result

    The following output properties are available:

    DisplayName string
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The resource name of the Folder. This uniquely identifies the folder.
    Parent string
    ApiMethod string
    DisplayName string
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The resource name of the Folder. This uniquely identifies the folder.
    Parent string
    ApiMethod string
    displayName String
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The resource name of the Folder. This uniquely identifies the folder.
    parent String
    apiMethod String
    displayName string
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    The resource name of the Folder. This uniquely identifies the folder.
    parent string
    apiMethod string
    display_name str
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    The resource name of the Folder. This uniquely identifies the folder.
    parent str
    api_method str
    displayName String
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The resource name of the Folder. This uniquely identifies the folder.
    parent String
    apiMethod String

    Package Details

    Repository
    Google Cloud (GCP) Classic pulumi/pulumi-gcp
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the google-beta Terraform Provider.
    gcp logo
    Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi