1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. ecs
  5. getEcsImageComponents
Alibaba Cloud v3.49.0 published on Sunday, Feb 4, 2024 by Pulumi

alicloud.ecs.getEcsImageComponents

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.49.0 published on Sunday, Feb 4, 2024 by Pulumi

    This data source provides the Ecs Image Components of the current Alibaba Cloud user.

    NOTE: Available in v1.159.0+.

    Example Usage

    Basic Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var ids = AliCloud.Ecs.GetEcsImageComponents.Invoke(new()
        {
            Ids = new[]
            {
                "example_id",
            },
        });
    
        var nameRegex = AliCloud.Ecs.GetEcsImageComponents.Invoke(new()
        {
            NameRegex = "^my-ImageComponent",
        });
    
        return new Dictionary<string, object?>
        {
            ["ecsImageComponentId1"] = ids.Apply(getEcsImageComponentsResult => getEcsImageComponentsResult.Components[0]?.Id),
            ["ecsImageComponentId2"] = nameRegex.Apply(getEcsImageComponentsResult => getEcsImageComponentsResult.Components[0]?.Id),
        };
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		ids, err := ecs.GetEcsImageComponents(ctx, &ecs.GetEcsImageComponentsArgs{
    			Ids: []string{
    				"example_id",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("ecsImageComponentId1", ids.Components[0].Id)
    		nameRegex, err := ecs.GetEcsImageComponents(ctx, &ecs.GetEcsImageComponentsArgs{
    			NameRegex: pulumi.StringRef("^my-ImageComponent"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("ecsImageComponentId2", nameRegex.Components[0].Id)
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.ecs.EcsFunctions;
    import com.pulumi.alicloud.ecs.inputs.GetEcsImageComponentsArgs;
    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 = EcsFunctions.getEcsImageComponents(GetEcsImageComponentsArgs.builder()
                .ids("example_id")
                .build());
    
            ctx.export("ecsImageComponentId1", ids.applyValue(getEcsImageComponentsResult -> getEcsImageComponentsResult.components()[0].id()));
            final var nameRegex = EcsFunctions.getEcsImageComponents(GetEcsImageComponentsArgs.builder()
                .nameRegex("^my-ImageComponent")
                .build());
    
            ctx.export("ecsImageComponentId2", nameRegex.applyValue(getEcsImageComponentsResult -> getEcsImageComponentsResult.components()[0].id()));
        }
    }
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    ids = alicloud.ecs.get_ecs_image_components(ids=["example_id"])
    pulumi.export("ecsImageComponentId1", ids.components[0].id)
    name_regex = alicloud.ecs.get_ecs_image_components(name_regex="^my-ImageComponent")
    pulumi.export("ecsImageComponentId2", name_regex.components[0].id)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const ids = alicloud.ecs.getEcsImageComponents({
        ids: ["example_id"],
    });
    export const ecsImageComponentId1 = ids.then(ids => ids.components?.[0]?.id);
    const nameRegex = alicloud.ecs.getEcsImageComponents({
        nameRegex: "^my-ImageComponent",
    });
    export const ecsImageComponentId2 = nameRegex.then(nameRegex => nameRegex.components?.[0]?.id);
    
    variables:
      ids:
        fn::invoke:
          Function: alicloud:ecs:getEcsImageComponents
          Arguments:
            ids:
              - example_id
      nameRegex:
        fn::invoke:
          Function: alicloud:ecs:getEcsImageComponents
          Arguments:
            nameRegex: ^my-ImageComponent
    outputs:
      ecsImageComponentId1: ${ids.components[0].id}
      ecsImageComponentId2: ${nameRegex.components[0].id}
    

    Using getEcsImageComponents

    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 getEcsImageComponents(args: GetEcsImageComponentsArgs, opts?: InvokeOptions): Promise<GetEcsImageComponentsResult>
    function getEcsImageComponentsOutput(args: GetEcsImageComponentsOutputArgs, opts?: InvokeOptions): Output<GetEcsImageComponentsResult>
    def get_ecs_image_components(ids: Optional[Sequence[str]] = None,
                                 image_component_name: Optional[str] = None,
                                 name_regex: Optional[str] = None,
                                 output_file: Optional[str] = None,
                                 owner: Optional[str] = None,
                                 resource_group_id: Optional[str] = None,
                                 tags: Optional[Mapping[str, Any]] = None,
                                 opts: Optional[InvokeOptions] = None) -> GetEcsImageComponentsResult
    def get_ecs_image_components_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                 image_component_name: Optional[pulumi.Input[str]] = None,
                                 name_regex: Optional[pulumi.Input[str]] = None,
                                 output_file: Optional[pulumi.Input[str]] = None,
                                 owner: Optional[pulumi.Input[str]] = None,
                                 resource_group_id: Optional[pulumi.Input[str]] = None,
                                 tags: Optional[pulumi.Input[Mapping[str, Any]]] = None,
                                 opts: Optional[InvokeOptions] = None) -> Output[GetEcsImageComponentsResult]
    func GetEcsImageComponents(ctx *Context, args *GetEcsImageComponentsArgs, opts ...InvokeOption) (*GetEcsImageComponentsResult, error)
    func GetEcsImageComponentsOutput(ctx *Context, args *GetEcsImageComponentsOutputArgs, opts ...InvokeOption) GetEcsImageComponentsResultOutput

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

    public static class GetEcsImageComponents 
    {
        public static Task<GetEcsImageComponentsResult> InvokeAsync(GetEcsImageComponentsArgs args, InvokeOptions? opts = null)
        public static Output<GetEcsImageComponentsResult> Invoke(GetEcsImageComponentsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetEcsImageComponentsResult> getEcsImageComponents(GetEcsImageComponentsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:ecs/getEcsImageComponents:getEcsImageComponents
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Ids List<string>
    A list of Image Component IDs.
    ImageComponentName string
    The name of the image component.
    NameRegex string
    A regex string to filter results by Image Component name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Owner string
    The type of the image component.
    ResourceGroupId string
    The ID of the resource group.
    Tags Dictionary<string, object>
    List of label key-value pairs.
    Ids []string
    A list of Image Component IDs.
    ImageComponentName string
    The name of the image component.
    NameRegex string
    A regex string to filter results by Image Component name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Owner string
    The type of the image component.
    ResourceGroupId string
    The ID of the resource group.
    Tags map[string]interface{}
    List of label key-value pairs.
    ids List<String>
    A list of Image Component IDs.
    imageComponentName String
    The name of the image component.
    nameRegex String
    A regex string to filter results by Image Component name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    owner String
    The type of the image component.
    resourceGroupId String
    The ID of the resource group.
    tags Map<String,Object>
    List of label key-value pairs.
    ids string[]
    A list of Image Component IDs.
    imageComponentName string
    The name of the image component.
    nameRegex string
    A regex string to filter results by Image Component name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    owner string
    The type of the image component.
    resourceGroupId string
    The ID of the resource group.
    tags {[key: string]: any}
    List of label key-value pairs.
    ids Sequence[str]
    A list of Image Component IDs.
    image_component_name str
    The name of the image component.
    name_regex str
    A regex string to filter results by Image Component name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    owner str
    The type of the image component.
    resource_group_id str
    The ID of the resource group.
    tags Mapping[str, Any]
    List of label key-value pairs.
    ids List<String>
    A list of Image Component IDs.
    imageComponentName String
    The name of the image component.
    nameRegex String
    A regex string to filter results by Image Component name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    owner String
    The type of the image component.
    resourceGroupId String
    The ID of the resource group.
    tags Map<Any>
    List of label key-value pairs.

    getEcsImageComponents Result

    The following output properties are available:

    Components List<Pulumi.AliCloud.Ecs.Outputs.GetEcsImageComponentsComponent>
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Names List<string>
    ImageComponentName string
    NameRegex string
    OutputFile string
    Owner string
    ResourceGroupId string
    Tags Dictionary<string, object>
    Components []GetEcsImageComponentsComponent
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Names []string
    ImageComponentName string
    NameRegex string
    OutputFile string
    Owner string
    ResourceGroupId string
    Tags map[string]interface{}
    components List<GetEcsImageComponentsComponent>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    imageComponentName String
    nameRegex String
    outputFile String
    owner String
    resourceGroupId String
    tags Map<String,Object>
    components GetEcsImageComponentsComponent[]
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    names string[]
    imageComponentName string
    nameRegex string
    outputFile string
    owner string
    resourceGroupId string
    tags {[key: string]: any}
    components Sequence[GetEcsImageComponentsComponent]
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    names Sequence[str]
    image_component_name str
    name_regex str
    output_file str
    owner str
    resource_group_id str
    tags Mapping[str, Any]
    components List<Property Map>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    imageComponentName String
    nameRegex String
    outputFile String
    owner String
    resourceGroupId String
    tags Map<Any>

    Supporting Types

    GetEcsImageComponentsComponent

    ComponentType string
    The type of the image component.
    Content string
    The content of the image component.
    CreateTime string
    The time when the image component was created.
    Description string
    The description of the image component.
    Id string
    The ID of the Image Component.
    ImageComponentId string
    The ID of the image component.
    ImageComponentName string
    The name of the image component.
    Owner string
    The type of the image component.
    ResourceGroupId string
    The ID of the resource group.
    SystemType string
    The operating system type supported by the image component.
    Tags Dictionary<string, object>
    List of label key-value pairs.
    ComponentType string
    The type of the image component.
    Content string
    The content of the image component.
    CreateTime string
    The time when the image component was created.
    Description string
    The description of the image component.
    Id string
    The ID of the Image Component.
    ImageComponentId string
    The ID of the image component.
    ImageComponentName string
    The name of the image component.
    Owner string
    The type of the image component.
    ResourceGroupId string
    The ID of the resource group.
    SystemType string
    The operating system type supported by the image component.
    Tags map[string]interface{}
    List of label key-value pairs.
    componentType String
    The type of the image component.
    content String
    The content of the image component.
    createTime String
    The time when the image component was created.
    description String
    The description of the image component.
    id String
    The ID of the Image Component.
    imageComponentId String
    The ID of the image component.
    imageComponentName String
    The name of the image component.
    owner String
    The type of the image component.
    resourceGroupId String
    The ID of the resource group.
    systemType String
    The operating system type supported by the image component.
    tags Map<String,Object>
    List of label key-value pairs.
    componentType string
    The type of the image component.
    content string
    The content of the image component.
    createTime string
    The time when the image component was created.
    description string
    The description of the image component.
    id string
    The ID of the Image Component.
    imageComponentId string
    The ID of the image component.
    imageComponentName string
    The name of the image component.
    owner string
    The type of the image component.
    resourceGroupId string
    The ID of the resource group.
    systemType string
    The operating system type supported by the image component.
    tags {[key: string]: any}
    List of label key-value pairs.
    component_type str
    The type of the image component.
    content str
    The content of the image component.
    create_time str
    The time when the image component was created.
    description str
    The description of the image component.
    id str
    The ID of the Image Component.
    image_component_id str
    The ID of the image component.
    image_component_name str
    The name of the image component.
    owner str
    The type of the image component.
    resource_group_id str
    The ID of the resource group.
    system_type str
    The operating system type supported by the image component.
    tags Mapping[str, Any]
    List of label key-value pairs.
    componentType String
    The type of the image component.
    content String
    The content of the image component.
    createTime String
    The time when the image component was created.
    description String
    The description of the image component.
    id String
    The ID of the Image Component.
    imageComponentId String
    The ID of the image component.
    imageComponentName String
    The name of the image component.
    owner String
    The type of the image component.
    resourceGroupId String
    The ID of the resource group.
    systemType String
    The operating system type supported by the image component.
    tags Map<Any>
    List of label key-value pairs.

    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.49.0 published on Sunday, Feb 4, 2024 by Pulumi