alicloud logo
Alibaba Cloud v3.34.0, Mar 17 23

alicloud.eds.RamDirectory

Provides a ECD Ram Directory resource.

For information about ECD Ram Directory and how to use it, see What is Ram Directory.

NOTE: Available in v1.174.0+.

Example Usage

Basic Usage

using System.Collections.Generic;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var defaultZones = AliCloud.Eds.GetZones.Invoke();

    var defaultNetworks = AliCloud.Vpc.GetNetworks.Invoke(new()
    {
        NameRegex = "default-NODELETING",
    });

    var defaultSwitches = AliCloud.Vpc.GetSwitches.Invoke(new()
    {
        VpcId = defaultNetworks.Apply(getNetworksResult => getNetworksResult.Ids[0]),
        ZoneId = defaultZones.Apply(getZonesResult => getZonesResult.Ids[0]),
    });

    var defaultRamDirectory = new AliCloud.Eds.RamDirectory("defaultRamDirectory", new()
    {
        DesktopAccessType = "INTERNET",
        EnableAdminAccess = true,
        EnableInternetAccess = true,
        RamDirectoryName = @var.Name,
        VswitchIds = new[]
        {
            defaultSwitches.Apply(getSwitchesResult => getSwitchesResult.Ids[0]),
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/eds"
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		defaultZones, err := eds.GetZones(ctx, nil, nil)
		if err != nil {
			return err
		}
		defaultNetworks, err := vpc.GetNetworks(ctx, &vpc.GetNetworksArgs{
			NameRegex: pulumi.StringRef("default-NODELETING"),
		}, nil)
		if err != nil {
			return err
		}
		defaultSwitches, err := vpc.GetSwitches(ctx, &vpc.GetSwitchesArgs{
			VpcId:  pulumi.StringRef(defaultNetworks.Ids[0]),
			ZoneId: pulumi.StringRef(defaultZones.Ids[0]),
		}, nil)
		if err != nil {
			return err
		}
		_, err = eds.NewRamDirectory(ctx, "defaultRamDirectory", &eds.RamDirectoryArgs{
			DesktopAccessType:    pulumi.String("INTERNET"),
			EnableAdminAccess:    pulumi.Bool(true),
			EnableInternetAccess: pulumi.Bool(true),
			RamDirectoryName:     pulumi.Any(_var.Name),
			VswitchIds: pulumi.StringArray{
				*pulumi.String(defaultSwitches.Ids[0]),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.eds.EdsFunctions;
import com.pulumi.alicloud.eds.inputs.GetZonesArgs;
import com.pulumi.alicloud.vpc.VpcFunctions;
import com.pulumi.alicloud.vpc.inputs.GetNetworksArgs;
import com.pulumi.alicloud.vpc.inputs.GetSwitchesArgs;
import com.pulumi.alicloud.eds.RamDirectory;
import com.pulumi.alicloud.eds.RamDirectoryArgs;
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 defaultZones = EdsFunctions.getZones();

        final var defaultNetworks = VpcFunctions.getNetworks(GetNetworksArgs.builder()
            .nameRegex("default-NODELETING")
            .build());

        final var defaultSwitches = VpcFunctions.getSwitches(GetSwitchesArgs.builder()
            .vpcId(defaultNetworks.applyValue(getNetworksResult -> getNetworksResult.ids()[0]))
            .zoneId(defaultZones.applyValue(getZonesResult -> getZonesResult.ids()[0]))
            .build());

        var defaultRamDirectory = new RamDirectory("defaultRamDirectory", RamDirectoryArgs.builder()        
            .desktopAccessType("INTERNET")
            .enableAdminAccess("true")
            .enableInternetAccess("true")
            .ramDirectoryName(var_.name())
            .vswitchIds(defaultSwitches.applyValue(getSwitchesResult -> getSwitchesResult.ids()[0]))
            .build());

    }
}
import pulumi
import pulumi_alicloud as alicloud

default_zones = alicloud.eds.get_zones()
default_networks = alicloud.vpc.get_networks(name_regex="default-NODELETING")
default_switches = alicloud.vpc.get_switches(vpc_id=default_networks.ids[0],
    zone_id=default_zones.ids[0])
default_ram_directory = alicloud.eds.RamDirectory("defaultRamDirectory",
    desktop_access_type="INTERNET",
    enable_admin_access=True,
    enable_internet_access=True,
    ram_directory_name=var["name"],
    vswitch_ids=[default_switches.ids[0]])
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const defaultZones = alicloud.eds.getZones({});
const defaultNetworks = alicloud.vpc.getNetworks({
    nameRegex: "default-NODELETING",
});
const defaultSwitches = Promise.all([defaultNetworks, defaultZones]).then(([defaultNetworks, defaultZones]) => alicloud.vpc.getSwitches({
    vpcId: defaultNetworks.ids?.[0],
    zoneId: defaultZones.ids?.[0],
}));
const defaultRamDirectory = new alicloud.eds.RamDirectory("defaultRamDirectory", {
    desktopAccessType: "INTERNET",
    enableAdminAccess: true,
    enableInternetAccess: true,
    ramDirectoryName: _var.name,
    vswitchIds: [defaultSwitches.then(defaultSwitches => defaultSwitches.ids?.[0])],
});
resources:
  defaultRamDirectory:
    type: alicloud:eds:RamDirectory
    properties:
      desktopAccessType: INTERNET
      enableAdminAccess: 'true'
      enableInternetAccess: 'true'
      ramDirectoryName: ${var.name}
      vswitchIds:
        - ${defaultSwitches.ids[0]}
variables:
  defaultZones:
    fn::invoke:
      Function: alicloud:eds:getZones
      Arguments: {}
  defaultNetworks:
    fn::invoke:
      Function: alicloud:vpc:getNetworks
      Arguments:
        nameRegex: default-NODELETING
  defaultSwitches:
    fn::invoke:
      Function: alicloud:vpc:getSwitches
      Arguments:
        vpcId: ${defaultNetworks.ids[0]}
        zoneId: ${defaultZones.ids[0]}

Create RamDirectory Resource

new RamDirectory(name: string, args: RamDirectoryArgs, opts?: CustomResourceOptions);
@overload
def RamDirectory(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 desktop_access_type: Optional[str] = None,
                 enable_admin_access: Optional[bool] = None,
                 enable_internet_access: Optional[bool] = None,
                 ram_directory_name: Optional[str] = None,
                 vswitch_ids: Optional[Sequence[str]] = None)
@overload
def RamDirectory(resource_name: str,
                 args: RamDirectoryArgs,
                 opts: Optional[ResourceOptions] = None)
func NewRamDirectory(ctx *Context, name string, args RamDirectoryArgs, opts ...ResourceOption) (*RamDirectory, error)
public RamDirectory(string name, RamDirectoryArgs args, CustomResourceOptions? opts = null)
public RamDirectory(String name, RamDirectoryArgs args)
public RamDirectory(String name, RamDirectoryArgs args, CustomResourceOptions options)
type: alicloud:eds:RamDirectory
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args RamDirectoryArgs
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 RamDirectoryArgs
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 RamDirectoryArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args RamDirectoryArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args RamDirectoryArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

RamDirectory Resource Properties

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

Inputs

The RamDirectory resource accepts the following input properties:

RamDirectoryName string

The name of the directory. The name must be 2 to 255 characters in length. It must start with a letter but cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), and hyphens (-).

VswitchIds List<string>

List of VSwitch IDs in the directory.

DesktopAccessType string

The desktop access type. Valid values: VPC, INTERNET, ANY.

EnableAdminAccess bool

Whether to enable public network access.

EnableInternetAccess bool

Whether to grant local administrator rights to users who use cloud desktops.

RamDirectoryName string

The name of the directory. The name must be 2 to 255 characters in length. It must start with a letter but cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), and hyphens (-).

VswitchIds []string

List of VSwitch IDs in the directory.

DesktopAccessType string

The desktop access type. Valid values: VPC, INTERNET, ANY.

EnableAdminAccess bool

Whether to enable public network access.

EnableInternetAccess bool

Whether to grant local administrator rights to users who use cloud desktops.

ramDirectoryName String

The name of the directory. The name must be 2 to 255 characters in length. It must start with a letter but cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), and hyphens (-).

vswitchIds List<String>

List of VSwitch IDs in the directory.

desktopAccessType String

The desktop access type. Valid values: VPC, INTERNET, ANY.

enableAdminAccess Boolean

Whether to enable public network access.

enableInternetAccess Boolean

Whether to grant local administrator rights to users who use cloud desktops.

ramDirectoryName string

The name of the directory. The name must be 2 to 255 characters in length. It must start with a letter but cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), and hyphens (-).

vswitchIds string[]

List of VSwitch IDs in the directory.

desktopAccessType string

The desktop access type. Valid values: VPC, INTERNET, ANY.

enableAdminAccess boolean

Whether to enable public network access.

enableInternetAccess boolean

Whether to grant local administrator rights to users who use cloud desktops.

ram_directory_name str

The name of the directory. The name must be 2 to 255 characters in length. It must start with a letter but cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), and hyphens (-).

vswitch_ids Sequence[str]

List of VSwitch IDs in the directory.

desktop_access_type str

The desktop access type. Valid values: VPC, INTERNET, ANY.

enable_admin_access bool

Whether to enable public network access.

enable_internet_access bool

Whether to grant local administrator rights to users who use cloud desktops.

ramDirectoryName String

The name of the directory. The name must be 2 to 255 characters in length. It must start with a letter but cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), and hyphens (-).

vswitchIds List<String>

List of VSwitch IDs in the directory.

desktopAccessType String

The desktop access type. Valid values: VPC, INTERNET, ANY.

enableAdminAccess Boolean

Whether to enable public network access.

enableInternetAccess Boolean

Whether to grant local administrator rights to users who use cloud desktops.

Outputs

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

Id string

The provider-assigned unique ID for this managed resource.

Status string

The status of directory.

Id string

The provider-assigned unique ID for this managed resource.

Status string

The status of directory.

id String

The provider-assigned unique ID for this managed resource.

status String

The status of directory.

id string

The provider-assigned unique ID for this managed resource.

status string

The status of directory.

id str

The provider-assigned unique ID for this managed resource.

status str

The status of directory.

id String

The provider-assigned unique ID for this managed resource.

status String

The status of directory.

Look up Existing RamDirectory Resource

Get an existing RamDirectory 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?: RamDirectoryState, opts?: CustomResourceOptions): RamDirectory
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        desktop_access_type: Optional[str] = None,
        enable_admin_access: Optional[bool] = None,
        enable_internet_access: Optional[bool] = None,
        ram_directory_name: Optional[str] = None,
        status: Optional[str] = None,
        vswitch_ids: Optional[Sequence[str]] = None) -> RamDirectory
func GetRamDirectory(ctx *Context, name string, id IDInput, state *RamDirectoryState, opts ...ResourceOption) (*RamDirectory, error)
public static RamDirectory Get(string name, Input<string> id, RamDirectoryState? state, CustomResourceOptions? opts = null)
public static RamDirectory get(String name, Output<String> id, RamDirectoryState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
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:
DesktopAccessType string

The desktop access type. Valid values: VPC, INTERNET, ANY.

EnableAdminAccess bool

Whether to enable public network access.

EnableInternetAccess bool

Whether to grant local administrator rights to users who use cloud desktops.

RamDirectoryName string

The name of the directory. The name must be 2 to 255 characters in length. It must start with a letter but cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), and hyphens (-).

Status string

The status of directory.

VswitchIds List<string>

List of VSwitch IDs in the directory.

DesktopAccessType string

The desktop access type. Valid values: VPC, INTERNET, ANY.

EnableAdminAccess bool

Whether to enable public network access.

EnableInternetAccess bool

Whether to grant local administrator rights to users who use cloud desktops.

RamDirectoryName string

The name of the directory. The name must be 2 to 255 characters in length. It must start with a letter but cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), and hyphens (-).

Status string

The status of directory.

VswitchIds []string

List of VSwitch IDs in the directory.

desktopAccessType String

The desktop access type. Valid values: VPC, INTERNET, ANY.

enableAdminAccess Boolean

Whether to enable public network access.

enableInternetAccess Boolean

Whether to grant local administrator rights to users who use cloud desktops.

ramDirectoryName String

The name of the directory. The name must be 2 to 255 characters in length. It must start with a letter but cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), and hyphens (-).

status String

The status of directory.

vswitchIds List<String>

List of VSwitch IDs in the directory.

desktopAccessType string

The desktop access type. Valid values: VPC, INTERNET, ANY.

enableAdminAccess boolean

Whether to enable public network access.

enableInternetAccess boolean

Whether to grant local administrator rights to users who use cloud desktops.

ramDirectoryName string

The name of the directory. The name must be 2 to 255 characters in length. It must start with a letter but cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), and hyphens (-).

status string

The status of directory.

vswitchIds string[]

List of VSwitch IDs in the directory.

desktop_access_type str

The desktop access type. Valid values: VPC, INTERNET, ANY.

enable_admin_access bool

Whether to enable public network access.

enable_internet_access bool

Whether to grant local administrator rights to users who use cloud desktops.

ram_directory_name str

The name of the directory. The name must be 2 to 255 characters in length. It must start with a letter but cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), and hyphens (-).

status str

The status of directory.

vswitch_ids Sequence[str]

List of VSwitch IDs in the directory.

desktopAccessType String

The desktop access type. Valid values: VPC, INTERNET, ANY.

enableAdminAccess Boolean

Whether to enable public network access.

enableInternetAccess Boolean

Whether to grant local administrator rights to users who use cloud desktops.

ramDirectoryName String

The name of the directory. The name must be 2 to 255 characters in length. It must start with a letter but cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), and hyphens (-).

status String

The status of directory.

vswitchIds List<String>

List of VSwitch IDs in the directory.

Import

ECD Ram Directory can be imported using the id, e.g.

 $ pulumi import alicloud:eds/ramDirectory:RamDirectory example <id>

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.