Alibaba Cloud

Pulumi Official
Package maintained by Pulumi
v3.19.0 published on Friday, Mar 18, 2022 by Pulumi

getDesktops

This data source provides the Ecd Desktops of the current Alibaba Cloud user.

NOTE: Available in v1.144.0+.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var defaultSimpleOfficeSite = new AliCloud.Eds.SimpleOfficeSite("defaultSimpleOfficeSite", new AliCloud.Eds.SimpleOfficeSiteArgs
        {
            CidrBlock = "172.16.0.0/12",
            DesktopAccessType = "Internet",
            OfficeSiteName = "your_office_site_name",
        });
        var defaultBundles = Output.Create(AliCloud.Eds.GetBundles.InvokeAsync(new AliCloud.Eds.GetBundlesArgs
        {
            BundleType = "SYSTEM",
        }));
        var defaultEcdPolicyGroup = new AliCloud.Eds.EcdPolicyGroup("defaultEcdPolicyGroup", new AliCloud.Eds.EcdPolicyGroupArgs
        {
            PolicyGroupName = "your_policy_group_name",
            Clipboard = "readwrite",
            LocalDrive = "read",
            AuthorizeAccessPolicyRules = 
            {
                new AliCloud.Eds.Inputs.EcdPolicyGroupAuthorizeAccessPolicyRuleArgs
                {
                    Description = "example_value",
                    CidrIp = "1.2.3.4/24",
                },
            },
            AuthorizeSecurityPolicyRules = 
            {
                new AliCloud.Eds.Inputs.EcdPolicyGroupAuthorizeSecurityPolicyRuleArgs
                {
                    Type = "inflow",
                    Policy = "accept",
                    Description = "example_value",
                    PortRange = "80/80",
                    IpProtocol = "TCP",
                    Priority = "1",
                    CidrIp = "0.0.0.0/0",
                },
            },
        });
        var defaultUser = new AliCloud.Eds.User("defaultUser", new AliCloud.Eds.UserArgs
        {
            EndUserId = "your_end_user_id",
            Email = "your_email",
            Phone = "your_phone",
            Password = "your_password",
        });
        var defaultDesktop = new AliCloud.Eds.Desktop("defaultDesktop", new AliCloud.Eds.DesktopArgs
        {
            OfficeSiteId = defaultSimpleOfficeSite.Id,
            PolicyGroupId = defaultEcdPolicyGroup.Id,
            BundleId = defaultBundles.Apply(defaultBundles => defaultBundles.Bundles?[0]?.Id),
            DesktopName = "your_desktop_name",
            EndUserIds = 
            {
                defaultUser.Id,
            },
        });
        var ids = AliCloud.Eds.GetDesktops.Invoke(new AliCloud.Eds.GetDesktopsInvokeArgs
        {
            Ids = 
            {
                defaultDesktop.Id,
            },
        });
        this.EcdDesktopId1 = ids.Apply(ids => ids.Desktops?[0]?.Id);
        var nameRegex = defaultDesktop.DesktopName.Apply(desktopName => AliCloud.Eds.GetDesktops.Invoke(new AliCloud.Eds.GetDesktopsInvokeArgs
        {
            NameRegex = desktopName,
        }));
        this.EcdDesktopId2 = nameRegex.Apply(nameRegex => nameRegex.Desktops?[0]?.Id);
    }

    [Output("ecdDesktopId1")]
    public Output<string> EcdDesktopId1 { get; set; }
    [Output("ecdDesktopId2")]
    public Output<string> EcdDesktopId2 { get; set; }
}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		defaultSimpleOfficeSite, err := eds.NewSimpleOfficeSite(ctx, "defaultSimpleOfficeSite", &eds.SimpleOfficeSiteArgs{
			CidrBlock:         pulumi.String("172.16.0.0/12"),
			DesktopAccessType: pulumi.String("Internet"),
			OfficeSiteName:    pulumi.String("your_office_site_name"),
		})
		if err != nil {
			return err
		}
		defaultBundles, err := eds.GetBundles(ctx, &eds.GetBundlesArgs{
			BundleType: pulumi.StringRef("SYSTEM"),
		}, nil)
		if err != nil {
			return err
		}
		defaultEcdPolicyGroup, err := eds.NewEcdPolicyGroup(ctx, "defaultEcdPolicyGroup", &eds.EcdPolicyGroupArgs{
			PolicyGroupName: pulumi.String("your_policy_group_name"),
			Clipboard:       pulumi.String("readwrite"),
			LocalDrive:      pulumi.String("read"),
			AuthorizeAccessPolicyRules: eds.EcdPolicyGroupAuthorizeAccessPolicyRuleArray{
				&eds.EcdPolicyGroupAuthorizeAccessPolicyRuleArgs{
					Description: pulumi.String("example_value"),
					CidrIp:      pulumi.String("1.2.3.4/24"),
				},
			},
			AuthorizeSecurityPolicyRules: eds.EcdPolicyGroupAuthorizeSecurityPolicyRuleArray{
				&eds.EcdPolicyGroupAuthorizeSecurityPolicyRuleArgs{
					Type:        pulumi.String("inflow"),
					Policy:      pulumi.String("accept"),
					Description: pulumi.String("example_value"),
					PortRange:   pulumi.String("80/80"),
					IpProtocol:  pulumi.String("TCP"),
					Priority:    pulumi.String("1"),
					CidrIp:      pulumi.String("0.0.0.0/0"),
				},
			},
		})
		if err != nil {
			return err
		}
		defaultUser, err := eds.NewUser(ctx, "defaultUser", &eds.UserArgs{
			EndUserId: pulumi.String("your_end_user_id"),
			Email:     pulumi.String("your_email"),
			Phone:     pulumi.String("your_phone"),
			Password:  pulumi.String("your_password"),
		})
		if err != nil {
			return err
		}
		defaultDesktop, err := eds.NewDesktop(ctx, "defaultDesktop", &eds.DesktopArgs{
			OfficeSiteId:  defaultSimpleOfficeSite.ID(),
			PolicyGroupId: defaultEcdPolicyGroup.ID(),
			BundleId:      pulumi.String(defaultBundles.Bundles[0].Id),
			DesktopName:   pulumi.String("your_desktop_name"),
			EndUserIds: pulumi.StringArray{
				defaultUser.ID(),
			},
		})
		if err != nil {
			return err
		}
		ids := eds.GetDesktopsOutput(ctx, eds.GetDesktopsOutputArgs{
			Ids: pulumi.StringArray{
				defaultDesktop.ID(),
			},
		}, nil)
		ctx.Export("ecdDesktopId1", ids.ApplyT(func(ids eds.GetDesktopsResult) (string, error) {
			return ids.Desktops[0].Id, nil
		}).(pulumi.StringOutput))
		ctx.Export("ecdDesktopId2", nameRegex.ApplyT(func(nameRegex eds.GetDesktopsResult) (string, error) {
			return nameRegex.Desktops[0].Id, nil
		}).(pulumi.StringOutput))
		return nil
	})
}

Coming soon!

import pulumi
import pulumi_alicloud as alicloud

default_simple_office_site = alicloud.eds.SimpleOfficeSite("defaultSimpleOfficeSite",
    cidr_block="172.16.0.0/12",
    desktop_access_type="Internet",
    office_site_name="your_office_site_name")
default_bundles = alicloud.eds.get_bundles(bundle_type="SYSTEM")
default_ecd_policy_group = alicloud.eds.EcdPolicyGroup("defaultEcdPolicyGroup",
    policy_group_name="your_policy_group_name",
    clipboard="readwrite",
    local_drive="read",
    authorize_access_policy_rules=[alicloud.eds.EcdPolicyGroupAuthorizeAccessPolicyRuleArgs(
        description="example_value",
        cidr_ip="1.2.3.4/24",
    )],
    authorize_security_policy_rules=[alicloud.eds.EcdPolicyGroupAuthorizeSecurityPolicyRuleArgs(
        type="inflow",
        policy="accept",
        description="example_value",
        port_range="80/80",
        ip_protocol="TCP",
        priority="1",
        cidr_ip="0.0.0.0/0",
    )])
default_user = alicloud.eds.User("defaultUser",
    end_user_id="your_end_user_id",
    email="your_email",
    phone="your_phone",
    password="your_password")
default_desktop = alicloud.eds.Desktop("defaultDesktop",
    office_site_id=default_simple_office_site.id,
    policy_group_id=default_ecd_policy_group.id,
    bundle_id=default_bundles.bundles[0].id,
    desktop_name="your_desktop_name",
    end_user_ids=[default_user.id])
ids = alicloud.eds.get_desktops_output(ids=[default_desktop.id])
pulumi.export("ecdDesktopId1", ids.desktops[0].id)
name_regex = default_desktop.desktop_name.apply(lambda desktop_name: alicloud.eds.get_desktops_output(name_regex=desktop_name))
pulumi.export("ecdDesktopId2", name_regex.desktops[0].id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const defaultSimpleOfficeSite = new alicloud.eds.SimpleOfficeSite("defaultSimpleOfficeSite", {
    cidrBlock: "172.16.0.0/12",
    desktopAccessType: "Internet",
    officeSiteName: "your_office_site_name",
});
const defaultBundles = alicloud.eds.getBundles({
    bundleType: "SYSTEM",
});
const defaultEcdPolicyGroup = new alicloud.eds.EcdPolicyGroup("defaultEcdPolicyGroup", {
    policyGroupName: "your_policy_group_name",
    clipboard: "readwrite",
    localDrive: "read",
    authorizeAccessPolicyRules: [{
        description: "example_value",
        cidrIp: "1.2.3.4/24",
    }],
    authorizeSecurityPolicyRules: [{
        type: "inflow",
        policy: "accept",
        description: "example_value",
        portRange: "80/80",
        ipProtocol: "TCP",
        priority: "1",
        cidrIp: "0.0.0.0/0",
    }],
});
const defaultUser = new alicloud.eds.User("defaultUser", {
    endUserId: "your_end_user_id",
    email: "your_email",
    phone: "your_phone",
    password: "your_password",
});
const defaultDesktop = new alicloud.eds.Desktop("defaultDesktop", {
    officeSiteId: defaultSimpleOfficeSite.id,
    policyGroupId: defaultEcdPolicyGroup.id,
    bundleId: defaultBundles.then(defaultBundles => defaultBundles.bundles?[0]?.id),
    desktopName: "your_desktop_name",
    endUserIds: [defaultUser.id],
});
const ids = alicloud.eds.getDesktopsOutput({
    ids: [defaultDesktop.id],
});
export const ecdDesktopId1 = ids.apply(ids => ids.desktops?[0]?.id);
const nameRegex = defaultDesktop.desktopName.apply(desktopName => alicloud.eds.getDesktopsOutput({
    nameRegex: desktopName,
}));
export const ecdDesktopId2 = nameRegex.apply(nameRegex => nameRegex.desktops?[0]?.id);

Coming soon!

Using getDesktops

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 getDesktops(args: GetDesktopsArgs, opts?: InvokeOptions): Promise<GetDesktopsResult>
function getDesktopsOutput(args: GetDesktopsOutputArgs, opts?: InvokeOptions): Output<GetDesktopsResult>
def get_desktops(desktop_name: Optional[str] = None,
                 end_user_ids: Optional[Sequence[str]] = None,
                 ids: Optional[Sequence[str]] = None,
                 name_regex: Optional[str] = None,
                 office_site_id: Optional[str] = None,
                 output_file: Optional[str] = None,
                 policy_group_id: Optional[str] = None,
                 status: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetDesktopsResult
def get_desktops_output(desktop_name: Optional[pulumi.Input[str]] = None,
                 end_user_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 name_regex: Optional[pulumi.Input[str]] = None,
                 office_site_id: Optional[pulumi.Input[str]] = None,
                 output_file: Optional[pulumi.Input[str]] = None,
                 policy_group_id: Optional[pulumi.Input[str]] = None,
                 status: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetDesktopsResult]
func GetDesktops(ctx *Context, args *GetDesktopsArgs, opts ...InvokeOption) (*GetDesktopsResult, error)
func GetDesktopsOutput(ctx *Context, args *GetDesktopsOutputArgs, opts ...InvokeOption) GetDesktopsResultOutput

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

public static class GetDesktops 
{
    public static Task<GetDesktopsResult> InvokeAsync(GetDesktopsArgs args, InvokeOptions? opts = null)
    public static Output<GetDesktopsResult> Invoke(GetDesktopsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetDesktopsResult> getDesktops(GetDesktopsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: alicloud:eds/getDesktops:getDesktops
  Arguments:
    # Arguments dictionary

The following arguments are supported:

DesktopName string

The desktop name of the Desktop.

EndUserIds List<string>

The desktop end user id of the Desktop.

Ids List<string>

A list of Desktop IDs.

NameRegex string

A regex string to filter results by Desktop name.

OfficeSiteId string

The ID of the Simple Office Site.

OutputFile string
PolicyGroupId string

The policy group id of the Desktop.

Status string

The status of the Desktop. Valid values: Deleted, Expired, Pending, Running, Starting, Stopped, Stopping.

DesktopName string

The desktop name of the Desktop.

EndUserIds []string

The desktop end user id of the Desktop.

Ids []string

A list of Desktop IDs.

NameRegex string

A regex string to filter results by Desktop name.

OfficeSiteId string

The ID of the Simple Office Site.

OutputFile string
PolicyGroupId string

The policy group id of the Desktop.

Status string

The status of the Desktop. Valid values: Deleted, Expired, Pending, Running, Starting, Stopped, Stopping.

desktopName String

The desktop name of the Desktop.

endUserIds List

The desktop end user id of the Desktop.

ids List

A list of Desktop IDs.

nameRegex String

A regex string to filter results by Desktop name.

officeSiteId String

The ID of the Simple Office Site.

outputFile String
policyGroupId String

The policy group id of the Desktop.

status String

The status of the Desktop. Valid values: Deleted, Expired, Pending, Running, Starting, Stopped, Stopping.

desktopName string

The desktop name of the Desktop.

endUserIds string[]

The desktop end user id of the Desktop.

ids string[]

A list of Desktop IDs.

nameRegex string

A regex string to filter results by Desktop name.

officeSiteId string

The ID of the Simple Office Site.

outputFile string
policyGroupId string

The policy group id of the Desktop.

status string

The status of the Desktop. Valid values: Deleted, Expired, Pending, Running, Starting, Stopped, Stopping.

desktop_name str

The desktop name of the Desktop.

end_user_ids Sequence[str]

The desktop end user id of the Desktop.

ids Sequence[str]

A list of Desktop IDs.

name_regex str

A regex string to filter results by Desktop name.

office_site_id str

The ID of the Simple Office Site.

output_file str
policy_group_id str

The policy group id of the Desktop.

status str

The status of the Desktop. Valid values: Deleted, Expired, Pending, Running, Starting, Stopped, Stopping.

desktopName String

The desktop name of the Desktop.

endUserIds List

The desktop end user id of the Desktop.

ids List

A list of Desktop IDs.

nameRegex String

A regex string to filter results by Desktop name.

officeSiteId String

The ID of the Simple Office Site.

outputFile String
policyGroupId String

The policy group id of the Desktop.

status String

The status of the Desktop. Valid values: Deleted, Expired, Pending, Running, Starting, Stopped, Stopping.

getDesktops Result

The following output properties are available:

Desktops List<Pulumi.AliCloud.Eds.Outputs.GetDesktopsDesktop>
Id string

The provider-assigned unique ID for this managed resource.

Ids List<string>
Names List<string>
DesktopName string
EndUserIds List<string>
NameRegex string
OfficeSiteId string
OutputFile string
PolicyGroupId string
Status string
Desktops []GetDesktopsDesktop
Id string

The provider-assigned unique ID for this managed resource.

Ids []string
Names []string
DesktopName string
EndUserIds []string
NameRegex string
OfficeSiteId string
OutputFile string
PolicyGroupId string
Status string
desktops ListDesktopsDesktop>
id String

The provider-assigned unique ID for this managed resource.

ids List
names List
desktopName String
endUserIds List
nameRegex String
officeSiteId String
outputFile String
policyGroupId String
status String
desktops GetDesktopsDesktop[]
id string

The provider-assigned unique ID for this managed resource.

ids string[]
names string[]
desktopName string
endUserIds string[]
nameRegex string
officeSiteId string
outputFile string
policyGroupId string
status string
desktops Sequence[GetDesktopsDesktop]
id str

The provider-assigned unique ID for this managed resource.

ids Sequence[str]
names Sequence[str]
desktop_name str
end_user_ids Sequence[str]
name_regex str
office_site_id str
output_file str
policy_group_id str
status str
desktops List
id String

The provider-assigned unique ID for this managed resource.

ids List
names List
desktopName String
endUserIds List
nameRegex String
officeSiteId String
outputFile String
policyGroupId String
status String

Supporting Types

GetDesktopsDesktop

Cpu int

The number of CPUs.

CreateTime string

The creation time of the Desktop.

DesktopId string

The desktop id of the Desktop.

DesktopName string

The desktop name of the Desktop.

DesktopType string

The desktop type of the Desktop.

DirectoryId string

The directory id of the Desktop.

EndUserIds List<string>

The desktop end user id of the Desktop.

ExpiredTime string

The expired time of the Desktop.

Id string

The ID of the Desktop.

ImageId string

The image id of the Desktop.

Memory string

The memory of the Desktop.

NetworkInterfaceId string

The network interface id of the Desktop.

PaymentType string

The payment type of the Desktop.

PolicyGroupId string

The policy group id of the Desktop.

Status string

The status of the Desktop. Valid values: Deleted, Expired, Pending, Running, Starting, Stopped, Stopping.

SystemDiskSize int

The system disk size of the Desktop.

Cpu int

The number of CPUs.

CreateTime string

The creation time of the Desktop.

DesktopId string

The desktop id of the Desktop.

DesktopName string

The desktop name of the Desktop.

DesktopType string

The desktop type of the Desktop.

DirectoryId string

The directory id of the Desktop.

EndUserIds []string

The desktop end user id of the Desktop.

ExpiredTime string

The expired time of the Desktop.

Id string

The ID of the Desktop.

ImageId string

The image id of the Desktop.

Memory string

The memory of the Desktop.

NetworkInterfaceId string

The network interface id of the Desktop.

PaymentType string

The payment type of the Desktop.

PolicyGroupId string

The policy group id of the Desktop.

Status string

The status of the Desktop. Valid values: Deleted, Expired, Pending, Running, Starting, Stopped, Stopping.

SystemDiskSize int

The system disk size of the Desktop.

cpu Integer

The number of CPUs.

createTime String

The creation time of the Desktop.

desktopId String

The desktop id of the Desktop.

desktopName String

The desktop name of the Desktop.

desktopType String

The desktop type of the Desktop.

directoryId String

The directory id of the Desktop.

endUserIds List

The desktop end user id of the Desktop.

expiredTime String

The expired time of the Desktop.

id String

The ID of the Desktop.

imageId String

The image id of the Desktop.

memory String

The memory of the Desktop.

networkInterfaceId String

The network interface id of the Desktop.

paymentType String

The payment type of the Desktop.

policyGroupId String

The policy group id of the Desktop.

status String

The status of the Desktop. Valid values: Deleted, Expired, Pending, Running, Starting, Stopped, Stopping.

systemDiskSize Integer

The system disk size of the Desktop.

cpu number

The number of CPUs.

createTime string

The creation time of the Desktop.

desktopId string

The desktop id of the Desktop.

desktopName string

The desktop name of the Desktop.

desktopType string

The desktop type of the Desktop.

directoryId string

The directory id of the Desktop.

endUserIds string[]

The desktop end user id of the Desktop.

expiredTime string

The expired time of the Desktop.

id string

The ID of the Desktop.

imageId string

The image id of the Desktop.

memory string

The memory of the Desktop.

networkInterfaceId string

The network interface id of the Desktop.

paymentType string

The payment type of the Desktop.

policyGroupId string

The policy group id of the Desktop.

status string

The status of the Desktop. Valid values: Deleted, Expired, Pending, Running, Starting, Stopped, Stopping.

systemDiskSize number

The system disk size of the Desktop.

cpu int

The number of CPUs.

create_time str

The creation time of the Desktop.

desktop_id str

The desktop id of the Desktop.

desktop_name str

The desktop name of the Desktop.

desktop_type str

The desktop type of the Desktop.

directory_id str

The directory id of the Desktop.

end_user_ids Sequence[str]

The desktop end user id of the Desktop.

expired_time str

The expired time of the Desktop.

id str

The ID of the Desktop.

image_id str

The image id of the Desktop.

memory str

The memory of the Desktop.

network_interface_id str

The network interface id of the Desktop.

payment_type str

The payment type of the Desktop.

policy_group_id str

The policy group id of the Desktop.

status str

The status of the Desktop. Valid values: Deleted, Expired, Pending, Running, Starting, Stopped, Stopping.

system_disk_size int

The system disk size of the Desktop.

cpu Number

The number of CPUs.

createTime String

The creation time of the Desktop.

desktopId String

The desktop id of the Desktop.

desktopName String

The desktop name of the Desktop.

desktopType String

The desktop type of the Desktop.

directoryId String

The directory id of the Desktop.

endUserIds List

The desktop end user id of the Desktop.

expiredTime String

The expired time of the Desktop.

id String

The ID of the Desktop.

imageId String

The image id of the Desktop.

memory String

The memory of the Desktop.

networkInterfaceId String

The network interface id of the Desktop.

paymentType String

The payment type of the Desktop.

policyGroupId String

The policy group id of the Desktop.

status String

The status of the Desktop. Valid values: Deleted, Expired, Pending, Running, Starting, Stopped, Stopping.

systemDiskSize Number

The system disk size of the Desktop.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.