1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. resourcemanager
  5. getResourceDirectories
Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 by Pulumi

alicloud.resourcemanager.getResourceDirectories

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 by Pulumi

    This data source provides the Resource Manager Resource Directories of the current Alibaba Cloud user.

    NOTE: Available in 1.86.0+.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const default = alicloud.resourcemanager.getResourceDirectories({});
    export const resourceDirectoryId = _default.then(_default => _default.directories?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default = alicloud.resourcemanager.get_resource_directories()
    pulumi.export("resourceDirectoryId", default.directories[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/resourcemanager"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_default, err := resourcemanager.GetResourceDirectories(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("resourceDirectoryId", _default.Directories[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = AliCloud.ResourceManager.GetResourceDirectories.Invoke();
    
        return new Dictionary<string, object?>
        {
            ["resourceDirectoryId"] = @default.Apply(@default => @default.Apply(getResourceDirectoriesResult => getResourceDirectoriesResult.Directories[0]?.Id)),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.resourcemanager.ResourcemanagerFunctions;
    import com.pulumi.alicloud.resourcemanager.inputs.GetResourceDirectoriesArgs;
    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 default = ResourcemanagerFunctions.getResourceDirectories();
    
            ctx.export("resourceDirectoryId", default_.directories()[0].id());
        }
    }
    
    variables:
      default:
        fn::invoke:
          Function: alicloud:resourcemanager:getResourceDirectories
          Arguments: {}
    outputs:
      resourceDirectoryId: ${default.directories[0].id}
    

    Using getResourceDirectories

    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 getResourceDirectories(args: GetResourceDirectoriesArgs, opts?: InvokeOptions): Promise<GetResourceDirectoriesResult>
    function getResourceDirectoriesOutput(args: GetResourceDirectoriesOutputArgs, opts?: InvokeOptions): Output<GetResourceDirectoriesResult>
    def get_resource_directories(output_file: Optional[str] = None,
                                 opts: Optional[InvokeOptions] = None) -> GetResourceDirectoriesResult
    def get_resource_directories_output(output_file: Optional[pulumi.Input[str]] = None,
                                 opts: Optional[InvokeOptions] = None) -> Output[GetResourceDirectoriesResult]
    func GetResourceDirectories(ctx *Context, args *GetResourceDirectoriesArgs, opts ...InvokeOption) (*GetResourceDirectoriesResult, error)
    func GetResourceDirectoriesOutput(ctx *Context, args *GetResourceDirectoriesOutputArgs, opts ...InvokeOption) GetResourceDirectoriesResultOutput

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

    public static class GetResourceDirectories 
    {
        public static Task<GetResourceDirectoriesResult> InvokeAsync(GetResourceDirectoriesArgs args, InvokeOptions? opts = null)
        public static Output<GetResourceDirectoriesResult> Invoke(GetResourceDirectoriesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetResourceDirectoriesResult> getResourceDirectories(GetResourceDirectoriesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:resourcemanager/getResourceDirectories:getResourceDirectories
      arguments:
        # arguments dictionary

    The following arguments are supported:

    OutputFile string
    File name where to save data source results (after running pulumi preview).
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    outputFile String
    File name where to save data source results (after running pulumi preview).
    outputFile string
    File name where to save data source results (after running pulumi preview).
    output_file str
    File name where to save data source results (after running pulumi preview).
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getResourceDirectories Result

    The following output properties are available:

    Directories List<Pulumi.AliCloud.ResourceManager.Outputs.GetResourceDirectoriesDirectory>
    A list of resource directories. Each element contains the following attributes:
    Id string
    The provider-assigned unique ID for this managed resource.
    OutputFile string
    Directories []GetResourceDirectoriesDirectory
    A list of resource directories. Each element contains the following attributes:
    Id string
    The provider-assigned unique ID for this managed resource.
    OutputFile string
    directories List<GetResourceDirectoriesDirectory>
    A list of resource directories. Each element contains the following attributes:
    id String
    The provider-assigned unique ID for this managed resource.
    outputFile String
    directories GetResourceDirectoriesDirectory[]
    A list of resource directories. Each element contains the following attributes:
    id string
    The provider-assigned unique ID for this managed resource.
    outputFile string
    directories Sequence[GetResourceDirectoriesDirectory]
    A list of resource directories. Each element contains the following attributes:
    id str
    The provider-assigned unique ID for this managed resource.
    output_file str
    directories List<Property Map>
    A list of resource directories. Each element contains the following attributes:
    id String
    The provider-assigned unique ID for this managed resource.
    outputFile String

    Supporting Types

    GetResourceDirectoriesDirectory

    Id string
    The ID of resource directory.
    MasterAccountId string
    The ID of the master account.
    MasterAccountName string
    The name of the master account.
    ResourceDirectoryId string
    The ID of the resource directory.
    RootFolderId string
    The ID of the root folder.
    Status string
    (Available in 1.120.0+.) The status of the control policy.
    Id string
    The ID of resource directory.
    MasterAccountId string
    The ID of the master account.
    MasterAccountName string
    The name of the master account.
    ResourceDirectoryId string
    The ID of the resource directory.
    RootFolderId string
    The ID of the root folder.
    Status string
    (Available in 1.120.0+.) The status of the control policy.
    id String
    The ID of resource directory.
    masterAccountId String
    The ID of the master account.
    masterAccountName String
    The name of the master account.
    resourceDirectoryId String
    The ID of the resource directory.
    rootFolderId String
    The ID of the root folder.
    status String
    (Available in 1.120.0+.) The status of the control policy.
    id string
    The ID of resource directory.
    masterAccountId string
    The ID of the master account.
    masterAccountName string
    The name of the master account.
    resourceDirectoryId string
    The ID of the resource directory.
    rootFolderId string
    The ID of the root folder.
    status string
    (Available in 1.120.0+.) The status of the control policy.
    id str
    The ID of resource directory.
    master_account_id str
    The ID of the master account.
    master_account_name str
    The name of the master account.
    resource_directory_id str
    The ID of the resource directory.
    root_folder_id str
    The ID of the root folder.
    status str
    (Available in 1.120.0+.) The status of the control policy.
    id String
    The ID of resource directory.
    masterAccountId String
    The ID of the master account.
    masterAccountName String
    The name of the master account.
    resourceDirectoryId String
    The ID of the resource directory.
    rootFolderId String
    The ID of the root folder.
    status String
    (Available in 1.120.0+.) The status of the control policy.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 by Pulumi