alicloud logo
Alibaba Cloud v3.34.0, Mar 17 23

alicloud.eds.getImages

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

NOTE: Available in v1.146.0+.

Example Usage

Basic Usage

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

return await Deployment.RunAsync(() => 
{
    var defaultSimpleOfficeSite = new AliCloud.Eds.SimpleOfficeSite("defaultSimpleOfficeSite", new()
    {
        CidrBlock = "172.16.0.0/12",
        DesktopAccessType = "Internet",
        OfficeSiteName = "your_simple_office_site_name",
    });

    var defaultBundles = AliCloud.Eds.GetBundles.Invoke(new()
    {
        BundleType = "SYSTEM",
    });

    var defaultEcdPolicyGroup = new AliCloud.Eds.EcdPolicyGroup("defaultEcdPolicyGroup", new()
    {
        PolicyGroupName = "your_policy_group_name",
        Clipboard = "readwrite",
        LocalDrive = "read",
        AuthorizeAccessPolicyRules = new[]
        {
            new AliCloud.Eds.Inputs.EcdPolicyGroupAuthorizeAccessPolicyRuleArgs
            {
                Description = "example_value",
                CidrIp = "1.2.3.4/24",
            },
        },
        AuthorizeSecurityPolicyRules = new[]
        {
            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 defaultDesktop = new AliCloud.Eds.Desktop("defaultDesktop", new()
    {
        OfficeSiteId = defaultSimpleOfficeSite.Id,
        PolicyGroupId = defaultEcdPolicyGroup.Id,
        BundleId = defaultBundles.Apply(getBundlesResult => getBundlesResult.Bundles[1]?.Id),
        DesktopName = "your_desktop_name",
    });

    var defaultImage = new AliCloud.Eds.Image("defaultImage", new()
    {
        ImageName = "your_image_name",
        DesktopId = defaultDesktop.Id,
        Description = "example_value",
    });

    var ids = AliCloud.Eds.GetImages.Invoke(new()
    {
        Ids = new[]
        {
            defaultImage.Id,
        },
    });

    var nameRegex = AliCloud.Eds.GetImages.Invoke(new()
    {
        NameRegex = defaultImage.ImageName,
    });

    return new Dictionary<string, object?>
    {
        ["ecdImageId1"] = ids.Apply(getImagesResult => getImagesResult.Images[0]?.Id),
        ["ecdImageId2"] = nameRegex.Apply(getImagesResult => getImagesResult.Images[0]?.Id),
    };
});
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_simple_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
		}
		defaultDesktop, err := eds.NewDesktop(ctx, "defaultDesktop", &eds.DesktopArgs{
			OfficeSiteId:  defaultSimpleOfficeSite.ID(),
			PolicyGroupId: defaultEcdPolicyGroup.ID(),
			BundleId:      *pulumi.String(defaultBundles.Bundles[1].Id),
			DesktopName:   pulumi.String("your_desktop_name"),
		})
		if err != nil {
			return err
		}
		defaultImage, err := eds.NewImage(ctx, "defaultImage", &eds.ImageArgs{
			ImageName:   pulumi.String("your_image_name"),
			DesktopId:   defaultDesktop.ID(),
			Description: pulumi.String("example_value"),
		})
		if err != nil {
			return err
		}
		ids := eds.GetImagesOutput(ctx, eds.GetImagesOutputArgs{
			Ids: pulumi.StringArray{
				defaultImage.ID(),
			},
		}, nil)
		ctx.Export("ecdImageId1", ids.ApplyT(func(ids eds.GetImagesResult) (*string, error) {
			return &ids.Images[0].Id, nil
		}).(pulumi.StringPtrOutput))
		nameRegex := defaultImage.ImageName.ApplyT(func(imageName *string) (eds.GetImagesResult, error) {
			return eds.GetImagesOutput(ctx, eds.GetImagesOutputArgs{
				NameRegex: imageName,
			}, nil), nil
		}).(eds.GetImagesResultOutput)
		ctx.Export("ecdImageId2", nameRegex.ApplyT(func(nameRegex eds.GetImagesResult) (*string, error) {
			return &nameRegex.Images[0].Id, nil
		}).(pulumi.StringPtrOutput))
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.eds.SimpleOfficeSite;
import com.pulumi.alicloud.eds.SimpleOfficeSiteArgs;
import com.pulumi.alicloud.eds.EdsFunctions;
import com.pulumi.alicloud.eds.inputs.GetBundlesArgs;
import com.pulumi.alicloud.eds.EcdPolicyGroup;
import com.pulumi.alicloud.eds.EcdPolicyGroupArgs;
import com.pulumi.alicloud.eds.inputs.EcdPolicyGroupAuthorizeAccessPolicyRuleArgs;
import com.pulumi.alicloud.eds.inputs.EcdPolicyGroupAuthorizeSecurityPolicyRuleArgs;
import com.pulumi.alicloud.eds.Desktop;
import com.pulumi.alicloud.eds.DesktopArgs;
import com.pulumi.alicloud.eds.Image;
import com.pulumi.alicloud.eds.ImageArgs;
import com.pulumi.alicloud.eds.inputs.GetImagesArgs;
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) {
        var defaultSimpleOfficeSite = new SimpleOfficeSite("defaultSimpleOfficeSite", SimpleOfficeSiteArgs.builder()        
            .cidrBlock("172.16.0.0/12")
            .desktopAccessType("Internet")
            .officeSiteName("your_simple_office_site_name")
            .build());

        final var defaultBundles = EdsFunctions.getBundles(GetBundlesArgs.builder()
            .bundleType("SYSTEM")
            .build());

        var defaultEcdPolicyGroup = new EcdPolicyGroup("defaultEcdPolicyGroup", EcdPolicyGroupArgs.builder()        
            .policyGroupName("your_policy_group_name")
            .clipboard("readwrite")
            .localDrive("read")
            .authorizeAccessPolicyRules(EcdPolicyGroupAuthorizeAccessPolicyRuleArgs.builder()
                .description("example_value")
                .cidrIp("1.2.3.4/24")
                .build())
            .authorizeSecurityPolicyRules(EcdPolicyGroupAuthorizeSecurityPolicyRuleArgs.builder()
                .type("inflow")
                .policy("accept")
                .description("example_value")
                .portRange("80/80")
                .ipProtocol("TCP")
                .priority("1")
                .cidrIp("0.0.0.0/0")
                .build())
            .build());

        var defaultDesktop = new Desktop("defaultDesktop", DesktopArgs.builder()        
            .officeSiteId(defaultSimpleOfficeSite.id())
            .policyGroupId(defaultEcdPolicyGroup.id())
            .bundleId(defaultBundles.applyValue(getBundlesResult -> getBundlesResult.bundles()[1].id()))
            .desktopName("your_desktop_name")
            .build());

        var defaultImage = new Image("defaultImage", ImageArgs.builder()        
            .imageName("your_image_name")
            .desktopId(defaultDesktop.id())
            .description("example_value")
            .build());

        final var ids = EdsFunctions.getImages(GetImagesArgs.builder()
            .ids(defaultImage.id())
            .build());

        ctx.export("ecdImageId1", ids.applyValue(getImagesResult -> getImagesResult).applyValue(ids -> ids.applyValue(getImagesResult -> getImagesResult.images()[0].id())));
        final var nameRegex = EdsFunctions.getImages(GetImagesArgs.builder()
            .nameRegex(defaultImage.imageName())
            .build());

        ctx.export("ecdImageId2", nameRegex.applyValue(getImagesResult -> getImagesResult).applyValue(nameRegex -> nameRegex.applyValue(getImagesResult -> getImagesResult.images()[0].id())));
    }
}
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_simple_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_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[1].id,
    desktop_name="your_desktop_name")
default_image = alicloud.eds.Image("defaultImage",
    image_name="your_image_name",
    desktop_id=default_desktop.id,
    description="example_value")
ids = alicloud.eds.get_images_output(ids=[default_image.id])
pulumi.export("ecdImageId1", ids.images[0].id)
name_regex = default_image.image_name.apply(lambda image_name: alicloud.eds.get_images_output(name_regex=image_name))
pulumi.export("ecdImageId2", name_regex.images[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_simple_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 defaultDesktop = new alicloud.eds.Desktop("defaultDesktop", {
    officeSiteId: defaultSimpleOfficeSite.id,
    policyGroupId: defaultEcdPolicyGroup.id,
    bundleId: defaultBundles.then(defaultBundles => defaultBundles.bundles?.[1]?.id),
    desktopName: "your_desktop_name",
});
const defaultImage = new alicloud.eds.Image("defaultImage", {
    imageName: "your_image_name",
    desktopId: defaultDesktop.id,
    description: "example_value",
});
const ids = alicloud.eds.getImagesOutput({
    ids: [defaultImage.id],
});
export const ecdImageId1 = ids.apply(ids => ids.images?.[0]?.id);
const nameRegex = defaultImage.imageName.apply(imageName => alicloud.eds.getImagesOutput({
    nameRegex: imageName,
}));
export const ecdImageId2 = nameRegex.apply(nameRegex => nameRegex.images?.[0]?.id);
resources:
  defaultSimpleOfficeSite:
    type: alicloud:eds:SimpleOfficeSite
    properties:
      cidrBlock: 172.16.0.0/12
      desktopAccessType: Internet
      officeSiteName: your_simple_office_site_name
  defaultEcdPolicyGroup:
    type: alicloud:eds:EcdPolicyGroup
    properties:
      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
  defaultDesktop:
    type: alicloud:eds:Desktop
    properties:
      officeSiteId: ${defaultSimpleOfficeSite.id}
      policyGroupId: ${defaultEcdPolicyGroup.id}
      bundleId: ${defaultBundles.bundles[1].id}
      desktopName: your_desktop_name
  defaultImage:
    type: alicloud:eds:Image
    properties:
      imageName: your_image_name
      desktopId: ${defaultDesktop.id}
      description: example_value
variables:
  defaultBundles:
    fn::invoke:
      Function: alicloud:eds:getBundles
      Arguments:
        bundleType: SYSTEM
  ids:
    fn::invoke:
      Function: alicloud:eds:getImages
      Arguments:
        ids:
          - ${defaultImage.id}
  nameRegex:
    fn::invoke:
      Function: alicloud:eds:getImages
      Arguments:
        nameRegex: ${defaultImage.imageName}
outputs:
  ecdImageId1: ${ids.images[0].id}
  ecdImageId2: ${nameRegex.images[0].id}

Using getImages

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 getImages(args: GetImagesArgs, opts?: InvokeOptions): Promise<GetImagesResult>
function getImagesOutput(args: GetImagesOutputArgs, opts?: InvokeOptions): Output<GetImagesResult>
def get_images(desktop_instance_type: Optional[str] = None,
               ids: Optional[Sequence[str]] = None,
               image_type: Optional[str] = None,
               name_regex: Optional[str] = None,
               os_type: Optional[str] = None,
               output_file: Optional[str] = None,
               status: Optional[str] = None,
               opts: Optional[InvokeOptions] = None) -> GetImagesResult
def get_images_output(desktop_instance_type: Optional[pulumi.Input[str]] = None,
               ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
               image_type: Optional[pulumi.Input[str]] = None,
               name_regex: Optional[pulumi.Input[str]] = None,
               os_type: Optional[pulumi.Input[str]] = None,
               output_file: Optional[pulumi.Input[str]] = None,
               status: Optional[pulumi.Input[str]] = None,
               opts: Optional[InvokeOptions] = None) -> Output[GetImagesResult]
func GetImages(ctx *Context, args *GetImagesArgs, opts ...InvokeOption) (*GetImagesResult, error)
func GetImagesOutput(ctx *Context, args *GetImagesOutputArgs, opts ...InvokeOption) GetImagesResultOutput

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

public static class GetImages 
{
    public static Task<GetImagesResult> InvokeAsync(GetImagesArgs args, InvokeOptions? opts = null)
    public static Output<GetImagesResult> Invoke(GetImagesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetImagesResult> getImages(GetImagesArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: alicloud:eds/getImages:getImages
  arguments:
    # arguments dictionary

The following arguments are supported:

DesktopInstanceType string

The desktop type of the image.

Ids List<string>

A list of Image IDs.

ImageType string

The image type of the image. Valid values: SYSTEM, CUSTOM.

NameRegex string

A regex string to filter results by Image name.

OsType string

The os type of the image.

OutputFile string
Status string

The status of the image. Valid values: Creating, Available, CreateFailed.

DesktopInstanceType string

The desktop type of the image.

Ids []string

A list of Image IDs.

ImageType string

The image type of the image. Valid values: SYSTEM, CUSTOM.

NameRegex string

A regex string to filter results by Image name.

OsType string

The os type of the image.

OutputFile string
Status string

The status of the image. Valid values: Creating, Available, CreateFailed.

desktopInstanceType String

The desktop type of the image.

ids List<String>

A list of Image IDs.

imageType String

The image type of the image. Valid values: SYSTEM, CUSTOM.

nameRegex String

A regex string to filter results by Image name.

osType String

The os type of the image.

outputFile String
status String

The status of the image. Valid values: Creating, Available, CreateFailed.

desktopInstanceType string

The desktop type of the image.

ids string[]

A list of Image IDs.

imageType string

The image type of the image. Valid values: SYSTEM, CUSTOM.

nameRegex string

A regex string to filter results by Image name.

osType string

The os type of the image.

outputFile string
status string

The status of the image. Valid values: Creating, Available, CreateFailed.

desktop_instance_type str

The desktop type of the image.

ids Sequence[str]

A list of Image IDs.

image_type str

The image type of the image. Valid values: SYSTEM, CUSTOM.

name_regex str

A regex string to filter results by Image name.

os_type str

The os type of the image.

output_file str
status str

The status of the image. Valid values: Creating, Available, CreateFailed.

desktopInstanceType String

The desktop type of the image.

ids List<String>

A list of Image IDs.

imageType String

The image type of the image. Valid values: SYSTEM, CUSTOM.

nameRegex String

A regex string to filter results by Image name.

osType String

The os type of the image.

outputFile String
status String

The status of the image. Valid values: Creating, Available, CreateFailed.

getImages Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Ids List<string>
Images List<Pulumi.AliCloud.Eds.Outputs.GetImagesImage>
Names List<string>
DesktopInstanceType string
ImageType string
NameRegex string
OsType string
OutputFile string
Status string
Id string

The provider-assigned unique ID for this managed resource.

Ids []string
Images []GetImagesImage
Names []string
DesktopInstanceType string
ImageType string
NameRegex string
OsType string
OutputFile string
Status string
id String

The provider-assigned unique ID for this managed resource.

ids List<String>
images List<GetImagesImage>
names List<String>
desktopInstanceType String
imageType String
nameRegex String
osType String
outputFile String
status String
id string

The provider-assigned unique ID for this managed resource.

ids string[]
images GetImagesImage[]
names string[]
desktopInstanceType string
imageType string
nameRegex string
osType string
outputFile string
status string
id str

The provider-assigned unique ID for this managed resource.

ids Sequence[str]
images Sequence[GetImagesImage]
names Sequence[str]
desktop_instance_type str
image_type str
name_regex str
os_type str
output_file str
status str
id String

The provider-assigned unique ID for this managed resource.

ids List<String>
images List<Property Map>
names List<String>
desktopInstanceType String
imageType String
nameRegex String
osType String
outputFile String
status String

Supporting Types

GetImagesImage

CreateTime string

The creation time of the image.

DataDiskSize int

The size of data disk of the image.

Description string

The description of the image.

GpuCategory bool

The Gpu Category of the image.

Id string

The ID of the Image.

ImageId string

The image id of the image.

ImageName string

The image name.

ImageType string

The image type of the image. Valid values: SYSTEM, CUSTOM.

OsType string

The os type of the image.

Progress string

The progress of the image.

Size int

The size of the image.

Status string

The status of the image. Valid values: Creating, Available, CreateFailed.

CreateTime string

The creation time of the image.

DataDiskSize int

The size of data disk of the image.

Description string

The description of the image.

GpuCategory bool

The Gpu Category of the image.

Id string

The ID of the Image.

ImageId string

The image id of the image.

ImageName string

The image name.

ImageType string

The image type of the image. Valid values: SYSTEM, CUSTOM.

OsType string

The os type of the image.

Progress string

The progress of the image.

Size int

The size of the image.

Status string

The status of the image. Valid values: Creating, Available, CreateFailed.

createTime String

The creation time of the image.

dataDiskSize Integer

The size of data disk of the image.

description String

The description of the image.

gpuCategory Boolean

The Gpu Category of the image.

id String

The ID of the Image.

imageId String

The image id of the image.

imageName String

The image name.

imageType String

The image type of the image. Valid values: SYSTEM, CUSTOM.

osType String

The os type of the image.

progress String

The progress of the image.

size Integer

The size of the image.

status String

The status of the image. Valid values: Creating, Available, CreateFailed.

createTime string

The creation time of the image.

dataDiskSize number

The size of data disk of the image.

description string

The description of the image.

gpuCategory boolean

The Gpu Category of the image.

id string

The ID of the Image.

imageId string

The image id of the image.

imageName string

The image name.

imageType string

The image type of the image. Valid values: SYSTEM, CUSTOM.

osType string

The os type of the image.

progress string

The progress of the image.

size number

The size of the image.

status string

The status of the image. Valid values: Creating, Available, CreateFailed.

create_time str

The creation time of the image.

data_disk_size int

The size of data disk of the image.

description str

The description of the image.

gpu_category bool

The Gpu Category of the image.

id str

The ID of the Image.

image_id str

The image id of the image.

image_name str

The image name.

image_type str

The image type of the image. Valid values: SYSTEM, CUSTOM.

os_type str

The os type of the image.

progress str

The progress of the image.

size int

The size of the image.

status str

The status of the image. Valid values: Creating, Available, CreateFailed.

createTime String

The creation time of the image.

dataDiskSize Number

The size of data disk of the image.

description String

The description of the image.

gpuCategory Boolean

The Gpu Category of the image.

id String

The ID of the Image.

imageId String

The image id of the image.

imageName String

The image name.

imageType String

The image type of the image. Valid values: SYSTEM, CUSTOM.

osType String

The os type of the image.

progress String

The progress of the image.

size Number

The size of the image.

status String

The status of the image. Valid values: Creating, Available, CreateFailed.

Package Details

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

This Pulumi package is based on the alicloud Terraform Provider.