1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. simpleapplicationserver
  5. getServerCustomImages
Alibaba Cloud v3.68.0 published on Monday, Dec 2, 2024 by Pulumi

alicloud.simpleapplicationserver.getServerCustomImages

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.68.0 published on Monday, Dec 2, 2024 by Pulumi

    This data source provides the Simple Application Server Custom Images of the current Alibaba Cloud user.

    NOTE: Available in v1.143.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const ids = alicloud.simpleapplicationserver.getServerCustomImages({
        ids: ["example_id"],
    });
    export const simpleApplicationServerCustomImageId1 = ids.then(ids => ids.images?.[0]?.id);
    const nameRegex = alicloud.simpleapplicationserver.getServerCustomImages({
        nameRegex: "^my-CustomImage",
    });
    export const simpleApplicationServerCustomImageId2 = nameRegex.then(nameRegex => nameRegex.images?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    ids = alicloud.simpleapplicationserver.get_server_custom_images(ids=["example_id"])
    pulumi.export("simpleApplicationServerCustomImageId1", ids.images[0].id)
    name_regex = alicloud.simpleapplicationserver.get_server_custom_images(name_regex="^my-CustomImage")
    pulumi.export("simpleApplicationServerCustomImageId2", name_regex.images[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/simpleapplicationserver"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		ids, err := simpleapplicationserver.GetServerCustomImages(ctx, &simpleapplicationserver.GetServerCustomImagesArgs{
    			Ids: []string{
    				"example_id",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("simpleApplicationServerCustomImageId1", ids.Images[0].Id)
    		nameRegex, err := simpleapplicationserver.GetServerCustomImages(ctx, &simpleapplicationserver.GetServerCustomImagesArgs{
    			NameRegex: pulumi.StringRef("^my-CustomImage"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("simpleApplicationServerCustomImageId2", nameRegex.Images[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var ids = AliCloud.SimpleApplicationServer.GetServerCustomImages.Invoke(new()
        {
            Ids = new[]
            {
                "example_id",
            },
        });
    
        var nameRegex = AliCloud.SimpleApplicationServer.GetServerCustomImages.Invoke(new()
        {
            NameRegex = "^my-CustomImage",
        });
    
        return new Dictionary<string, object?>
        {
            ["simpleApplicationServerCustomImageId1"] = ids.Apply(getServerCustomImagesResult => getServerCustomImagesResult.Images[0]?.Id),
            ["simpleApplicationServerCustomImageId2"] = nameRegex.Apply(getServerCustomImagesResult => getServerCustomImagesResult.Images[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.simpleapplicationserver.SimpleapplicationserverFunctions;
    import com.pulumi.alicloud.simpleapplicationserver.inputs.GetServerCustomImagesArgs;
    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 ids = SimpleapplicationserverFunctions.getServerCustomImages(GetServerCustomImagesArgs.builder()
                .ids("example_id")
                .build());
    
            ctx.export("simpleApplicationServerCustomImageId1", ids.applyValue(getServerCustomImagesResult -> getServerCustomImagesResult.images()[0].id()));
            final var nameRegex = SimpleapplicationserverFunctions.getServerCustomImages(GetServerCustomImagesArgs.builder()
                .nameRegex("^my-CustomImage")
                .build());
    
            ctx.export("simpleApplicationServerCustomImageId2", nameRegex.applyValue(getServerCustomImagesResult -> getServerCustomImagesResult.images()[0].id()));
        }
    }
    
    variables:
      ids:
        fn::invoke:
          Function: alicloud:simpleapplicationserver:getServerCustomImages
          Arguments:
            ids:
              - example_id
      nameRegex:
        fn::invoke:
          Function: alicloud:simpleapplicationserver:getServerCustomImages
          Arguments:
            nameRegex: ^my-CustomImage
    outputs:
      simpleApplicationServerCustomImageId1: ${ids.images[0].id}
      simpleApplicationServerCustomImageId2: ${nameRegex.images[0].id}
    

    Using getServerCustomImages

    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 getServerCustomImages(args: GetServerCustomImagesArgs, opts?: InvokeOptions): Promise<GetServerCustomImagesResult>
    function getServerCustomImagesOutput(args: GetServerCustomImagesOutputArgs, opts?: InvokeOptions): Output<GetServerCustomImagesResult>
    def get_server_custom_images(ids: Optional[Sequence[str]] = None,
                                 name_regex: Optional[str] = None,
                                 output_file: Optional[str] = None,
                                 opts: Optional[InvokeOptions] = None) -> GetServerCustomImagesResult
    def get_server_custom_images_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                 name_regex: Optional[pulumi.Input[str]] = None,
                                 output_file: Optional[pulumi.Input[str]] = None,
                                 opts: Optional[InvokeOptions] = None) -> Output[GetServerCustomImagesResult]
    func GetServerCustomImages(ctx *Context, args *GetServerCustomImagesArgs, opts ...InvokeOption) (*GetServerCustomImagesResult, error)
    func GetServerCustomImagesOutput(ctx *Context, args *GetServerCustomImagesOutputArgs, opts ...InvokeOption) GetServerCustomImagesResultOutput

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

    public static class GetServerCustomImages 
    {
        public static Task<GetServerCustomImagesResult> InvokeAsync(GetServerCustomImagesArgs args, InvokeOptions? opts = null)
        public static Output<GetServerCustomImagesResult> Invoke(GetServerCustomImagesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetServerCustomImagesResult> getServerCustomImages(GetServerCustomImagesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:simpleapplicationserver/getServerCustomImages:getServerCustomImages
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Ids List<string>
    A list of Custom Image IDs.
    NameRegex string
    A regex string to filter results by Custom Image name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Ids []string
    A list of Custom Image IDs.
    NameRegex string
    A regex string to filter results by Custom Image name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    ids List<String>
    A list of Custom Image IDs.
    nameRegex String
    A regex string to filter results by Custom Image name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    ids string[]
    A list of Custom Image IDs.
    nameRegex string
    A regex string to filter results by Custom Image name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    ids Sequence[str]
    A list of Custom Image IDs.
    name_regex str
    A regex string to filter results by Custom Image name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    ids List<String>
    A list of Custom Image IDs.
    nameRegex String
    A regex string to filter results by Custom Image name.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getServerCustomImages 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.SimpleApplicationServer.Outputs.GetServerCustomImagesImage>
    Names List<string>
    NameRegex string
    OutputFile string
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Images []GetServerCustomImagesImage
    Names []string
    NameRegex string
    OutputFile string
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    images List<GetServerCustomImagesImage>
    names List<String>
    nameRegex String
    outputFile String
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    images GetServerCustomImagesImage[]
    names string[]
    nameRegex string
    outputFile string
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    images Sequence[GetServerCustomImagesImage]
    names Sequence[str]
    name_regex str
    output_file str
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    images List<Property Map>
    names List<String>
    nameRegex String
    outputFile String

    Supporting Types

    GetServerCustomImagesImage

    CustomImageId string
    The first ID of the resource.
    CustomImageName string
    The name of the resource.
    Description string
    Image description information.
    Id string
    The ID of the Custom Image.
    Platform string
    The type of operating system used by the Mirror. Valid values: Linux, Windows.
    CustomImageId string
    The first ID of the resource.
    CustomImageName string
    The name of the resource.
    Description string
    Image description information.
    Id string
    The ID of the Custom Image.
    Platform string
    The type of operating system used by the Mirror. Valid values: Linux, Windows.
    customImageId String
    The first ID of the resource.
    customImageName String
    The name of the resource.
    description String
    Image description information.
    id String
    The ID of the Custom Image.
    platform String
    The type of operating system used by the Mirror. Valid values: Linux, Windows.
    customImageId string
    The first ID of the resource.
    customImageName string
    The name of the resource.
    description string
    Image description information.
    id string
    The ID of the Custom Image.
    platform string
    The type of operating system used by the Mirror. Valid values: Linux, Windows.
    custom_image_id str
    The first ID of the resource.
    custom_image_name str
    The name of the resource.
    description str
    Image description information.
    id str
    The ID of the Custom Image.
    platform str
    The type of operating system used by the Mirror. Valid values: Linux, Windows.
    customImageId String
    The first ID of the resource.
    customImageName String
    The name of the resource.
    description String
    Image description information.
    id String
    The ID of the Custom Image.
    platform String
    The type of operating system used by the Mirror. Valid values: Linux, Windows.

    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.68.0 published on Monday, Dec 2, 2024 by Pulumi