Alibaba Cloud
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:
- Desktop
Name string The desktop name of the Desktop.
- End
User List<string>Ids The desktop end user id of the Desktop.
- Ids List<string>
A list of Desktop IDs.
- Name
Regex string A regex string to filter results by Desktop name.
- Office
Site stringId The ID of the Simple Office Site.
- Output
File string - Policy
Group stringId 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 string The desktop name of the Desktop.
- End
User []stringIds The desktop end user id of the Desktop.
- Ids []string
A list of Desktop IDs.
- Name
Regex string A regex string to filter results by Desktop name.
- Office
Site stringId The ID of the Simple Office Site.
- Output
File string - Policy
Group stringId 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 String The desktop name of the Desktop.
- end
User List<String>Ids The desktop end user id of the Desktop.
- ids List<String>
A list of Desktop IDs.
- name
Regex String A regex string to filter results by Desktop name.
- office
Site StringId The ID of the Simple Office Site.
- output
File String - policy
Group StringId 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 string The desktop name of the Desktop.
- end
User string[]Ids The desktop end user id of the Desktop.
- ids string[]
A list of Desktop IDs.
- name
Regex string A regex string to filter results by Desktop name.
- office
Site stringId The ID of the Simple Office Site.
- output
File string - policy
Group stringId 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_ Sequence[str]ids 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_ strid The ID of the Simple Office Site.
- output_
file str - policy_
group_ strid The policy group id of the Desktop.
- status str
The status of the Desktop. Valid values:
Deleted
,Expired
,Pending
,Running
,Starting
,Stopped
,Stopping
.
- desktop
Name String The desktop name of the Desktop.
- end
User List<String>Ids The desktop end user id of the Desktop.
- ids List<String>
A list of Desktop IDs.
- name
Regex String A regex string to filter results by Desktop name.
- office
Site StringId The ID of the Simple Office Site.
- output
File String - policy
Group StringId 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.
Ali Cloud. Eds. Outputs. Get Desktops Desktop> - Id string
The provider-assigned unique ID for this managed resource.
- Ids List<string>
- Names List<string>
- Desktop
Name string - End
User List<string>Ids - Name
Regex string - Office
Site stringId - Output
File string - Policy
Group stringId - Status string
- Desktops
[]Get
Desktops Desktop - Id string
The provider-assigned unique ID for this managed resource.
- Ids []string
- Names []string
- Desktop
Name string - End
User []stringIds - Name
Regex string - Office
Site stringId - Output
File string - Policy
Group stringId - Status string
- desktops
List<Get
Desktops Desktop> - id String
The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- desktop
Name String - end
User List<String>Ids - name
Regex String - office
Site StringId - output
File String - policy
Group StringId - status String
- desktops
Get
Desktops Desktop[] - id string
The provider-assigned unique ID for this managed resource.
- ids string[]
- names string[]
- desktop
Name string - end
User string[]Ids - name
Regex string - office
Site stringId - output
File string - policy
Group stringId - status string
- desktops
Sequence[Get
Desktops Desktop] - id str
The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- names Sequence[str]
- desktop_
name str - end_
user_ Sequence[str]ids - name_
regex str - office_
site_ strid - output_
file str - policy_
group_ strid - status str
- desktops List<Property Map>
- id String
The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- desktop
Name String - end
User List<String>Ids - name
Regex String - office
Site StringId - output
File String - policy
Group StringId - status String
Supporting Types
GetDesktopsDesktop
- Cpu int
The number of CPUs.
- Create
Time string The creation time of the Desktop.
- Desktop
Id string The desktop id of the Desktop.
- Desktop
Name string The desktop name of the Desktop.
- Desktop
Type string The desktop type of the Desktop.
- Directory
Id string The directory id of the Desktop.
- End
User List<string>Ids The desktop end user id of the Desktop.
- Expired
Time string The expired time of the Desktop.
- Id string
The ID of the Desktop.
- Image
Id string The image id of the Desktop.
- Memory string
The memory of the Desktop.
- Network
Interface stringId The network interface id of the Desktop.
- Payment
Type string The payment type of the Desktop.
- Policy
Group stringId The policy group id of the Desktop.
- Status string
The status of the Desktop. Valid values:
Deleted
,Expired
,Pending
,Running
,Starting
,Stopped
,Stopping
.- System
Disk intSize The system disk size of the Desktop.
- Cpu int
The number of CPUs.
- Create
Time string The creation time of the Desktop.
- Desktop
Id string The desktop id of the Desktop.
- Desktop
Name string The desktop name of the Desktop.
- Desktop
Type string The desktop type of the Desktop.
- Directory
Id string The directory id of the Desktop.
- End
User []stringIds The desktop end user id of the Desktop.
- Expired
Time string The expired time of the Desktop.
- Id string
The ID of the Desktop.
- Image
Id string The image id of the Desktop.
- Memory string
The memory of the Desktop.
- Network
Interface stringId The network interface id of the Desktop.
- Payment
Type string The payment type of the Desktop.
- Policy
Group stringId The policy group id of the Desktop.
- Status string
The status of the Desktop. Valid values:
Deleted
,Expired
,Pending
,Running
,Starting
,Stopped
,Stopping
.- System
Disk intSize The system disk size of the Desktop.
- cpu Integer
The number of CPUs.
- create
Time String The creation time of the Desktop.
- desktop
Id String The desktop id of the Desktop.
- desktop
Name String The desktop name of the Desktop.
- desktop
Type String The desktop type of the Desktop.
- directory
Id String The directory id of the Desktop.
- end
User List<String>Ids The desktop end user id of the Desktop.
- expired
Time String The expired time of the Desktop.
- id String
The ID of the Desktop.
- image
Id String The image id of the Desktop.
- memory String
The memory of the Desktop.
- network
Interface StringId The network interface id of the Desktop.
- payment
Type String The payment type of the Desktop.
- policy
Group StringId The policy group id of the Desktop.
- status String
The status of the Desktop. Valid values:
Deleted
,Expired
,Pending
,Running
,Starting
,Stopped
,Stopping
.- system
Disk IntegerSize The system disk size of the Desktop.
- cpu number
The number of CPUs.
- create
Time string The creation time of the Desktop.
- desktop
Id string The desktop id of the Desktop.
- desktop
Name string The desktop name of the Desktop.
- desktop
Type string The desktop type of the Desktop.
- directory
Id string The directory id of the Desktop.
- end
User string[]Ids The desktop end user id of the Desktop.
- expired
Time string The expired time of the Desktop.
- id string
The ID of the Desktop.
- image
Id string The image id of the Desktop.
- memory string
The memory of the Desktop.
- network
Interface stringId The network interface id of the Desktop.
- payment
Type string The payment type of the Desktop.
- policy
Group stringId The policy group id of the Desktop.
- status string
The status of the Desktop. Valid values:
Deleted
,Expired
,Pending
,Running
,Starting
,Stopped
,Stopping
.- system
Disk numberSize 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_ Sequence[str]ids 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_ strid The network interface id of the Desktop.
- payment_
type str The payment type of the Desktop.
- policy_
group_ strid 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_ intsize The system disk size of the Desktop.
- cpu Number
The number of CPUs.
- create
Time String The creation time of the Desktop.
- desktop
Id String The desktop id of the Desktop.
- desktop
Name String The desktop name of the Desktop.
- desktop
Type String The desktop type of the Desktop.
- directory
Id String The directory id of the Desktop.
- end
User List<String>Ids The desktop end user id of the Desktop.
- expired
Time String The expired time of the Desktop.
- id String
The ID of the Desktop.
- image
Id String The image id of the Desktop.
- memory String
The memory of the Desktop.
- network
Interface StringId The network interface id of the Desktop.
- payment
Type String The payment type of the Desktop.
- policy
Group StringId The policy group id of the Desktop.
- status String
The status of the Desktop. Valid values:
Deleted
,Expired
,Pending
,Running
,Starting
,Stopped
,Stopping
.- system
Disk NumberSize 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.