1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. resourcemanager
  5. ResourceDirectory
Alibaba Cloud v3.85.0 published on Tuesday, Sep 9, 2025 by Pulumi

alicloud.resourcemanager.ResourceDirectory

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.85.0 published on Tuesday, Sep 9, 2025 by Pulumi

    Provides a Resource Manager Resource Directory resource.

    For information about Resource Manager Resource Directory and how to use it, see What is Resource Directory.

    NOTE: Available since v1.84.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const _default = alicloud.resourcemanager.getResourceDirectories({});
    const defaultResourceDirectory: alicloud.resourcemanager.ResourceDirectory[] = [];
    _default.then(_default => _default.directories).length.apply(length => {
        for (const range = {value: 0}; range.value < (length > 0 ? 0 : 1); range.value++) {
            defaultResourceDirectory.push(new alicloud.resourcemanager.ResourceDirectory(`default-${range.value}`, {status: "Enabled"}));
        }
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default = alicloud.resourcemanager.get_resource_directories()
    default_resource_directory = []
    def create_default(range_body):
        for range in [{"value": i} for i in range(0, range_body)]:
            default_resource_directory.append(alicloud.resourcemanager.ResourceDirectory(f"default-{range['value']}", status="Enabled"))
    
    len(default.directories).apply(lambda resolved_outputs: create_default(0 if resolved_outputs['length'] > 0 else 1))
    
    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, &resourcemanager.GetResourceDirectoriesArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		var tmp0 float64
    		if length > 0 {
    			tmp0 = 0
    		} else {
    			tmp0 = 1
    		}
    		var defaultResourceDirectory []*resourcemanager.ResourceDirectory
    		for index := 0; index < float64(len(_default.Directories).ApplyT(func(length int) (float64, error) {
    			return tmp0, nil
    		}).(pulumi.Float64Output)); index++ {
    			key0 := index
    			_ := index
    			__res, err := resourcemanager.NewResourceDirectory(ctx, fmt.Sprintf("default-%v", key0), &resourcemanager.ResourceDirectoryArgs{
    				Status: pulumi.String("Enabled"),
    			})
    			if err != nil {
    				return err
    			}
    			defaultResourceDirectory = append(defaultResourceDirectory, __res)
    		}
    		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();
    
        var defaultResourceDirectory = new List<AliCloud.ResourceManager.ResourceDirectory>();
        for (var rangeIndex = 0; rangeIndex < @default.Apply(@default => @default.Apply(getResourceDirectoriesResult => getResourceDirectoriesResult.Directories)).Length.Apply(length => length > 0 ? 0 : 1); rangeIndex++)
        {
            var range = new { Value = rangeIndex };
            defaultResourceDirectory.Add(new AliCloud.ResourceManager.ResourceDirectory($"default-{range.Value}", new()
            {
                Status = "Enabled",
            }));
        }
    });
    
    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 com.pulumi.alicloud.resourcemanager.ResourceDirectory;
    import com.pulumi.alicloud.resourcemanager.ResourceDirectoryArgs;
    import com.pulumi.codegen.internal.KeyedValue;
    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(GetResourceDirectoriesArgs.builder()
                .build());
    
            for (var i = 0; i < default_.directories().length().applyValue(_length -> _length > 0 ? 0 : 1); i++) {
                new ResourceDirectory("defaultResourceDirectory-" + i, ResourceDirectoryArgs.builder()
                    .status("Enabled")
                    .build());
    
            
    }
        }
    }
    
    resources:
      defaultResourceDirectory:
        type: alicloud:resourcemanager:ResourceDirectory
        name: default
        properties:
          status: Enabled
        options: {}
    variables:
      default:
        fn::invoke:
          function: alicloud:resourcemanager:getResourceDirectories
          arguments: {}
    

    Create ResourceDirectory Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ResourceDirectory(name: string, args?: ResourceDirectoryArgs, opts?: CustomResourceOptions);
    @overload
    def ResourceDirectory(resource_name: str,
                          args: Optional[ResourceDirectoryArgs] = None,
                          opts: Optional[ResourceOptions] = None)
    
    @overload
    def ResourceDirectory(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          member_account_display_name_sync_status: Optional[str] = None,
                          member_deletion_status: Optional[str] = None,
                          status: Optional[str] = None)
    func NewResourceDirectory(ctx *Context, name string, args *ResourceDirectoryArgs, opts ...ResourceOption) (*ResourceDirectory, error)
    public ResourceDirectory(string name, ResourceDirectoryArgs? args = null, CustomResourceOptions? opts = null)
    public ResourceDirectory(String name, ResourceDirectoryArgs args)
    public ResourceDirectory(String name, ResourceDirectoryArgs args, CustomResourceOptions options)
    
    type: alicloud:resourcemanager:ResourceDirectory
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args ResourceDirectoryArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args ResourceDirectoryArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args ResourceDirectoryArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ResourceDirectoryArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ResourceDirectoryArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var resourceDirectoryResource = new AliCloud.ResourceManager.ResourceDirectory("resourceDirectoryResource", new()
    {
        MemberAccountDisplayNameSyncStatus = "string",
        MemberDeletionStatus = "string",
        Status = "string",
    });
    
    example, err := resourcemanager.NewResourceDirectory(ctx, "resourceDirectoryResource", &resourcemanager.ResourceDirectoryArgs{
    	MemberAccountDisplayNameSyncStatus: pulumi.String("string"),
    	MemberDeletionStatus:               pulumi.String("string"),
    	Status:                             pulumi.String("string"),
    })
    
    var resourceDirectoryResource = new ResourceDirectory("resourceDirectoryResource", ResourceDirectoryArgs.builder()
        .memberAccountDisplayNameSyncStatus("string")
        .memberDeletionStatus("string")
        .status("string")
        .build());
    
    resource_directory_resource = alicloud.resourcemanager.ResourceDirectory("resourceDirectoryResource",
        member_account_display_name_sync_status="string",
        member_deletion_status="string",
        status="string")
    
    const resourceDirectoryResource = new alicloud.resourcemanager.ResourceDirectory("resourceDirectoryResource", {
        memberAccountDisplayNameSyncStatus: "string",
        memberDeletionStatus: "string",
        status: "string",
    });
    
    type: alicloud:resourcemanager:ResourceDirectory
    properties:
        memberAccountDisplayNameSyncStatus: string
        memberDeletionStatus: string
        status: string
    

    ResourceDirectory Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The ResourceDirectory resource accepts the following input properties:

    MemberAccountDisplayNameSyncStatus string
    The status of the Member Display Name Synchronization feature. Valid values:

    • Enabled
    • Disabled
    MemberDeletionStatus string
    The status of the member deletion feature. Valid values:

    • Enabled: The feature is enabled. You can call the DeleteAccount operation to delete members of the resource account type.
    • Disabled: The feature is disabled. You cannot delete members of the resource account type.
    Status string
    ScpStatus
    MemberAccountDisplayNameSyncStatus string
    The status of the Member Display Name Synchronization feature. Valid values:

    • Enabled
    • Disabled
    MemberDeletionStatus string
    The status of the member deletion feature. Valid values:

    • Enabled: The feature is enabled. You can call the DeleteAccount operation to delete members of the resource account type.
    • Disabled: The feature is disabled. You cannot delete members of the resource account type.
    Status string
    ScpStatus
    memberAccountDisplayNameSyncStatus String
    The status of the Member Display Name Synchronization feature. Valid values:

    • Enabled
    • Disabled
    memberDeletionStatus String
    The status of the member deletion feature. Valid values:

    • Enabled: The feature is enabled. You can call the DeleteAccount operation to delete members of the resource account type.
    • Disabled: The feature is disabled. You cannot delete members of the resource account type.
    status String
    ScpStatus
    memberAccountDisplayNameSyncStatus string
    The status of the Member Display Name Synchronization feature. Valid values:

    • Enabled
    • Disabled
    memberDeletionStatus string
    The status of the member deletion feature. Valid values:

    • Enabled: The feature is enabled. You can call the DeleteAccount operation to delete members of the resource account type.
    • Disabled: The feature is disabled. You cannot delete members of the resource account type.
    status string
    ScpStatus
    member_account_display_name_sync_status str
    The status of the Member Display Name Synchronization feature. Valid values:

    • Enabled
    • Disabled
    member_deletion_status str
    The status of the member deletion feature. Valid values:

    • Enabled: The feature is enabled. You can call the DeleteAccount operation to delete members of the resource account type.
    • Disabled: The feature is disabled. You cannot delete members of the resource account type.
    status str
    ScpStatus
    memberAccountDisplayNameSyncStatus String
    The status of the Member Display Name Synchronization feature. Valid values:

    • Enabled
    • Disabled
    memberDeletionStatus String
    The status of the member deletion feature. Valid values:

    • Enabled: The feature is enabled. You can call the DeleteAccount operation to delete members of the resource account type.
    • Disabled: The feature is disabled. You cannot delete members of the resource account type.
    status String
    ScpStatus

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ResourceDirectory resource produces the following output properties:

    CreateTime string
    The time when the resource directory was created
    Id string
    The provider-assigned unique ID for this managed resource.
    MasterAccountId string
    The ID of the master account
    MasterAccountName string
    The name of the master account
    RootFolderId string
    The ID of the root folder
    CreateTime string
    The time when the resource directory was created
    Id string
    The provider-assigned unique ID for this managed resource.
    MasterAccountId string
    The ID of the master account
    MasterAccountName string
    The name of the master account
    RootFolderId string
    The ID of the root folder
    createTime String
    The time when the resource directory was created
    id String
    The provider-assigned unique ID for this managed resource.
    masterAccountId String
    The ID of the master account
    masterAccountName String
    The name of the master account
    rootFolderId String
    The ID of the root folder
    createTime string
    The time when the resource directory was created
    id string
    The provider-assigned unique ID for this managed resource.
    masterAccountId string
    The ID of the master account
    masterAccountName string
    The name of the master account
    rootFolderId string
    The ID of the root folder
    create_time str
    The time when the resource directory was created
    id str
    The provider-assigned unique ID for this managed resource.
    master_account_id str
    The ID of the master account
    master_account_name str
    The name of the master account
    root_folder_id str
    The ID of the root folder
    createTime String
    The time when the resource directory was created
    id String
    The provider-assigned unique ID for this managed resource.
    masterAccountId String
    The ID of the master account
    masterAccountName String
    The name of the master account
    rootFolderId String
    The ID of the root folder

    Look up Existing ResourceDirectory Resource

    Get an existing ResourceDirectory resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: ResourceDirectoryState, opts?: CustomResourceOptions): ResourceDirectory
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            create_time: Optional[str] = None,
            master_account_id: Optional[str] = None,
            master_account_name: Optional[str] = None,
            member_account_display_name_sync_status: Optional[str] = None,
            member_deletion_status: Optional[str] = None,
            root_folder_id: Optional[str] = None,
            status: Optional[str] = None) -> ResourceDirectory
    func GetResourceDirectory(ctx *Context, name string, id IDInput, state *ResourceDirectoryState, opts ...ResourceOption) (*ResourceDirectory, error)
    public static ResourceDirectory Get(string name, Input<string> id, ResourceDirectoryState? state, CustomResourceOptions? opts = null)
    public static ResourceDirectory get(String name, Output<String> id, ResourceDirectoryState state, CustomResourceOptions options)
    resources:  _:    type: alicloud:resourcemanager:ResourceDirectory    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    CreateTime string
    The time when the resource directory was created
    MasterAccountId string
    The ID of the master account
    MasterAccountName string
    The name of the master account
    MemberAccountDisplayNameSyncStatus string
    The status of the Member Display Name Synchronization feature. Valid values:

    • Enabled
    • Disabled
    MemberDeletionStatus string
    The status of the member deletion feature. Valid values:

    • Enabled: The feature is enabled. You can call the DeleteAccount operation to delete members of the resource account type.
    • Disabled: The feature is disabled. You cannot delete members of the resource account type.
    RootFolderId string
    The ID of the root folder
    Status string
    ScpStatus
    CreateTime string
    The time when the resource directory was created
    MasterAccountId string
    The ID of the master account
    MasterAccountName string
    The name of the master account
    MemberAccountDisplayNameSyncStatus string
    The status of the Member Display Name Synchronization feature. Valid values:

    • Enabled
    • Disabled
    MemberDeletionStatus string
    The status of the member deletion feature. Valid values:

    • Enabled: The feature is enabled. You can call the DeleteAccount operation to delete members of the resource account type.
    • Disabled: The feature is disabled. You cannot delete members of the resource account type.
    RootFolderId string
    The ID of the root folder
    Status string
    ScpStatus
    createTime String
    The time when the resource directory was created
    masterAccountId String
    The ID of the master account
    masterAccountName String
    The name of the master account
    memberAccountDisplayNameSyncStatus String
    The status of the Member Display Name Synchronization feature. Valid values:

    • Enabled
    • Disabled
    memberDeletionStatus String
    The status of the member deletion feature. Valid values:

    • Enabled: The feature is enabled. You can call the DeleteAccount operation to delete members of the resource account type.
    • Disabled: The feature is disabled. You cannot delete members of the resource account type.
    rootFolderId String
    The ID of the root folder
    status String
    ScpStatus
    createTime string
    The time when the resource directory was created
    masterAccountId string
    The ID of the master account
    masterAccountName string
    The name of the master account
    memberAccountDisplayNameSyncStatus string
    The status of the Member Display Name Synchronization feature. Valid values:

    • Enabled
    • Disabled
    memberDeletionStatus string
    The status of the member deletion feature. Valid values:

    • Enabled: The feature is enabled. You can call the DeleteAccount operation to delete members of the resource account type.
    • Disabled: The feature is disabled. You cannot delete members of the resource account type.
    rootFolderId string
    The ID of the root folder
    status string
    ScpStatus
    create_time str
    The time when the resource directory was created
    master_account_id str
    The ID of the master account
    master_account_name str
    The name of the master account
    member_account_display_name_sync_status str
    The status of the Member Display Name Synchronization feature. Valid values:

    • Enabled
    • Disabled
    member_deletion_status str
    The status of the member deletion feature. Valid values:

    • Enabled: The feature is enabled. You can call the DeleteAccount operation to delete members of the resource account type.
    • Disabled: The feature is disabled. You cannot delete members of the resource account type.
    root_folder_id str
    The ID of the root folder
    status str
    ScpStatus
    createTime String
    The time when the resource directory was created
    masterAccountId String
    The ID of the master account
    masterAccountName String
    The name of the master account
    memberAccountDisplayNameSyncStatus String
    The status of the Member Display Name Synchronization feature. Valid values:

    • Enabled
    • Disabled
    memberDeletionStatus String
    The status of the member deletion feature. Valid values:

    • Enabled: The feature is enabled. You can call the DeleteAccount operation to delete members of the resource account type.
    • Disabled: The feature is disabled. You cannot delete members of the resource account type.
    rootFolderId String
    The ID of the root folder
    status String
    ScpStatus

    Import

    Resource Manager Resource Directory can be imported using the id, e.g.

    $ pulumi import alicloud:resourcemanager/resourceDirectory:ResourceDirectory example <id>
    

    To learn more about importing existing cloud resources, see Importing resources.

    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.85.0 published on Tuesday, Sep 9, 2025 by Pulumi