alicloud.resourcemanager.ResourceDirectory
Explore with Pulumi AI
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:
- Member
Account stringDisplay Name Sync Status - The status of the Member Display Name Synchronization feature. Valid values:
- Enabled
- Disabled
- Member
Deletion stringStatus - 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 stringDisplay Name Sync Status - The status of the Member Display Name Synchronization feature. Valid values:
- Enabled
- Disabled
- Member
Deletion stringStatus - 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 StringDisplay Name Sync Status - The status of the Member Display Name Synchronization feature. Valid values:
- Enabled
- Disabled
- member
Deletion StringStatus - 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 stringDisplay Name Sync Status - The status of the Member Display Name Synchronization feature. Valid values:
- Enabled
- Disabled
- member
Deletion stringStatus - 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_ strdisplay_ name_ sync_ status - The status of the Member Display Name Synchronization feature. Valid values:
- Enabled
- Disabled
- member_
deletion_ strstatus - 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
- member
Account StringDisplay Name Sync Status - The status of the Member Display Name Synchronization feature. Valid values:
- Enabled
- Disabled
- member
Deletion StringStatus - 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:
- Create
Time string - The time when the resource directory was created
- Id string
- The provider-assigned unique ID for this managed resource.
- Master
Account stringId - The ID of the master account
- Master
Account stringName - The name of the master account
- Root
Folder stringId - The ID of the root folder
- Create
Time string - The time when the resource directory was created
- Id string
- The provider-assigned unique ID for this managed resource.
- Master
Account stringId - The ID of the master account
- Master
Account stringName - The name of the master account
- Root
Folder stringId - The ID of the root folder
- create
Time String - The time when the resource directory was created
- id String
- The provider-assigned unique ID for this managed resource.
- master
Account StringId - The ID of the master account
- master
Account StringName - The name of the master account
- root
Folder StringId - The ID of the root folder
- create
Time string - The time when the resource directory was created
- id string
- The provider-assigned unique ID for this managed resource.
- master
Account stringId - The ID of the master account
- master
Account stringName - The name of the master account
- root
Folder stringId - 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_ strid - The ID of the master account
- master_
account_ strname - The name of the master account
- root_
folder_ strid - The ID of the root folder
- create
Time String - The time when the resource directory was created
- id String
- The provider-assigned unique ID for this managed resource.
- master
Account StringId - The ID of the master account
- master
Account StringName - The name of the master account
- root
Folder StringId - 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.
- Create
Time string - The time when the resource directory was created
- Master
Account stringId - The ID of the master account
- Master
Account stringName - The name of the master account
- Member
Account stringDisplay Name Sync Status - The status of the Member Display Name Synchronization feature. Valid values:
- Enabled
- Disabled
- Member
Deletion stringStatus - 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 stringId - The ID of the root folder
- Status string
- ScpStatus
- Create
Time string - The time when the resource directory was created
- Master
Account stringId - The ID of the master account
- Master
Account stringName - The name of the master account
- Member
Account stringDisplay Name Sync Status - The status of the Member Display Name Synchronization feature. Valid values:
- Enabled
- Disabled
- Member
Deletion stringStatus - 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 stringId - The ID of the root folder
- Status string
- ScpStatus
- create
Time String - The time when the resource directory was created
- master
Account StringId - The ID of the master account
- master
Account StringName - The name of the master account
- member
Account StringDisplay Name Sync Status - The status of the Member Display Name Synchronization feature. Valid values:
- Enabled
- Disabled
- member
Deletion StringStatus - 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 StringId - The ID of the root folder
- status String
- ScpStatus
- create
Time string - The time when the resource directory was created
- master
Account stringId - The ID of the master account
- master
Account stringName - The name of the master account
- member
Account stringDisplay Name Sync Status - The status of the Member Display Name Synchronization feature. Valid values:
- Enabled
- Disabled
- member
Deletion stringStatus - 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 stringId - The ID of the root folder
- status string
- ScpStatus
- create_
time str - The time when the resource directory was created
- master_
account_ strid - The ID of the master account
- master_
account_ strname - The name of the master account
- member_
account_ strdisplay_ name_ sync_ status - The status of the Member Display Name Synchronization feature. Valid values:
- Enabled
- Disabled
- member_
deletion_ strstatus - 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_ strid - The ID of the root folder
- status str
- ScpStatus
- create
Time String - The time when the resource directory was created
- master
Account StringId - The ID of the master account
- master
Account StringName - The name of the master account
- member
Account StringDisplay Name Sync Status - The status of the Member Display Name Synchronization feature. Valid values:
- Enabled
- Disabled
- member
Deletion StringStatus - 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 StringId - 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.