1. Packages
  2. Alicloud Provider
  3. API Docs
  4. eds
  5. RamDirectory
Alibaba Cloud v3.63.0 published on Monday, Sep 30, 2024 by Pulumi

alicloud.eds.RamDirectory

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.63.0 published on Monday, Sep 30, 2024 by Pulumi

    Provides a ECD Ram Directory resource.

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

    NOTE: Available since v1.174.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "terraform-example";
    const default = alicloud.eds.getZones({});
    const defaultNetwork = new alicloud.vpc.Network("default", {
        vpcName: name,
        cidrBlock: "172.16.0.0/16",
    });
    const defaultSwitch = new alicloud.vpc.Switch("default", {
        vpcId: defaultNetwork.id,
        cidrBlock: "172.16.0.0/24",
        zoneId: _default.then(_default => _default.ids?.[0]),
        vswitchName: name,
    });
    const defaultRamDirectory = new alicloud.eds.RamDirectory("default", {
        desktopAccessType: "INTERNET",
        enableAdminAccess: true,
        ramDirectoryName: name,
        vswitchIds: [defaultSwitch.id],
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform-example"
    default = alicloud.eds.get_zones()
    default_network = alicloud.vpc.Network("default",
        vpc_name=name,
        cidr_block="172.16.0.0/16")
    default_switch = alicloud.vpc.Switch("default",
        vpc_id=default_network.id,
        cidr_block="172.16.0.0/24",
        zone_id=default.ids[0],
        vswitch_name=name)
    default_ram_directory = alicloud.eds.RamDirectory("default",
        desktop_access_type="INTERNET",
        enable_admin_access=True,
        ram_directory_name=name,
        vswitch_ids=[default_switch.id])
    
    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"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "terraform-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		_default, err := eds.GetZones(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		defaultNetwork, err := vpc.NewNetwork(ctx, "default", &vpc.NetworkArgs{
    			VpcName:   pulumi.String(name),
    			CidrBlock: pulumi.String("172.16.0.0/16"),
    		})
    		if err != nil {
    			return err
    		}
    		defaultSwitch, err := vpc.NewSwitch(ctx, "default", &vpc.SwitchArgs{
    			VpcId:       defaultNetwork.ID(),
    			CidrBlock:   pulumi.String("172.16.0.0/24"),
    			ZoneId:      pulumi.String(_default.Ids[0]),
    			VswitchName: pulumi.String(name),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = eds.NewRamDirectory(ctx, "default", &eds.RamDirectoryArgs{
    			DesktopAccessType: pulumi.String("INTERNET"),
    			EnableAdminAccess: pulumi.Bool(true),
    			RamDirectoryName:  pulumi.String(name),
    			VswitchIds: pulumi.StringArray{
    				defaultSwitch.ID(),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "terraform-example";
        var @default = AliCloud.Eds.GetZones.Invoke();
    
        var defaultNetwork = new AliCloud.Vpc.Network("default", new()
        {
            VpcName = name,
            CidrBlock = "172.16.0.0/16",
        });
    
        var defaultSwitch = new AliCloud.Vpc.Switch("default", new()
        {
            VpcId = defaultNetwork.Id,
            CidrBlock = "172.16.0.0/24",
            ZoneId = @default.Apply(@default => @default.Apply(getZonesResult => getZonesResult.Ids[0])),
            VswitchName = name,
        });
    
        var defaultRamDirectory = new AliCloud.Eds.RamDirectory("default", new()
        {
            DesktopAccessType = "INTERNET",
            EnableAdminAccess = true,
            RamDirectoryName = name,
            VswitchIds = new[]
            {
                defaultSwitch.Id,
            },
        });
    
    });
    
    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.Network;
    import com.pulumi.alicloud.vpc.NetworkArgs;
    import com.pulumi.alicloud.vpc.Switch;
    import com.pulumi.alicloud.vpc.SwitchArgs;
    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 config = ctx.config();
            final var name = config.get("name").orElse("terraform-example");
            final var default = EdsFunctions.getZones();
    
            var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
                .vpcName(name)
                .cidrBlock("172.16.0.0/16")
                .build());
    
            var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()
                .vpcId(defaultNetwork.id())
                .cidrBlock("172.16.0.0/24")
                .zoneId(default_.ids()[0])
                .vswitchName(name)
                .build());
    
            var defaultRamDirectory = new RamDirectory("defaultRamDirectory", RamDirectoryArgs.builder()
                .desktopAccessType("INTERNET")
                .enableAdminAccess(true)
                .ramDirectoryName(name)
                .vswitchIds(defaultSwitch.id())
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform-example
    resources:
      defaultNetwork:
        type: alicloud:vpc:Network
        name: default
        properties:
          vpcName: ${name}
          cidrBlock: 172.16.0.0/16
      defaultSwitch:
        type: alicloud:vpc:Switch
        name: default
        properties:
          vpcId: ${defaultNetwork.id}
          cidrBlock: 172.16.0.0/24
          zoneId: ${default.ids[0]}
          vswitchName: ${name}
      defaultRamDirectory:
        type: alicloud:eds:RamDirectory
        name: default
        properties:
          desktopAccessType: INTERNET
          enableAdminAccess: true
          ramDirectoryName: ${name}
          vswitchIds:
            - ${defaultSwitch.id}
    variables:
      default:
        fn::invoke:
          Function: alicloud:eds:getZones
          Arguments: {}
    

    Create RamDirectory Resource

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

    Constructor syntax

    new RamDirectory(name: string, args: RamDirectoryArgs, opts?: CustomResourceOptions);
    @overload
    def RamDirectory(resource_name: str,
                     args: RamDirectoryArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def RamDirectory(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     ram_directory_name: Optional[str] = None,
                     vswitch_ids: Optional[Sequence[str]] = None,
                     desktop_access_type: Optional[str] = None,
                     enable_admin_access: Optional[bool] = None,
                     enable_internet_access: Optional[bool] = 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.
    
    

    Parameters

    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.

    Constructor example

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

    var ramDirectoryResource = new AliCloud.Eds.RamDirectory("ramDirectoryResource", new()
    {
        RamDirectoryName = "string",
        VswitchIds = new[]
        {
            "string",
        },
        DesktopAccessType = "string",
        EnableAdminAccess = false,
        EnableInternetAccess = false,
    });
    
    example, err := eds.NewRamDirectory(ctx, "ramDirectoryResource", &eds.RamDirectoryArgs{
    	RamDirectoryName: pulumi.String("string"),
    	VswitchIds: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	DesktopAccessType:    pulumi.String("string"),
    	EnableAdminAccess:    pulumi.Bool(false),
    	EnableInternetAccess: pulumi.Bool(false),
    })
    
    var ramDirectoryResource = new RamDirectory("ramDirectoryResource", RamDirectoryArgs.builder()
        .ramDirectoryName("string")
        .vswitchIds("string")
        .desktopAccessType("string")
        .enableAdminAccess(false)
        .enableInternetAccess(false)
        .build());
    
    ram_directory_resource = alicloud.eds.RamDirectory("ramDirectoryResource",
        ram_directory_name="string",
        vswitch_ids=["string"],
        desktop_access_type="string",
        enable_admin_access=False,
        enable_internet_access=False)
    
    const ramDirectoryResource = new alicloud.eds.RamDirectory("ramDirectoryResource", {
        ramDirectoryName: "string",
        vswitchIds: ["string"],
        desktopAccessType: "string",
        enableAdminAccess: false,
        enableInternetAccess: false,
    });
    
    type: alicloud:eds:RamDirectory
    properties:
        desktopAccessType: string
        enableAdminAccess: false
        enableInternetAccess: false
        ramDirectoryName: string
        vswitchIds:
            - string
    

    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>
    

    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.63.0 published on Monday, Sep 30, 2024 by Pulumi