Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi
alicloud.ecs.getEcsImageComponents
Explore with Pulumi AI
This data source provides the Ecs Image Components of the current Alibaba Cloud user.
NOTE: Available in v1.159.0+.
Example Usage
Basic Usage
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);
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)
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
})
}
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 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()));
}
}
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, str]] = 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, pulumi.Input[str]]]] = 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.
- Image
Component stringName - The name of the component.
- Name
Regex string - A regex string to filter results by Image Component name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Owner string
- Mirror component type. Valid values:
SELF
orALIYUN
. Possible values:- SELF: The custom image component you created.
- ALIYUN: System components provided by Alibaba Cloud.
- Resource
Group stringId - The ID of the resource group.
- Dictionary<string, string>
- A mapping of tags to assign to the resource.
- Ids []string
- A list of Image Component IDs.
- Image
Component stringName - The name of the component.
- Name
Regex string - A regex string to filter results by Image Component name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Owner string
- Mirror component type. Valid values:
SELF
orALIYUN
. Possible values:- SELF: The custom image component you created.
- ALIYUN: System components provided by Alibaba Cloud.
- Resource
Group stringId - The ID of the resource group.
- map[string]string
- A mapping of tags to assign to the resource.
- ids List<String>
- A list of Image Component IDs.
- image
Component StringName - The name of the component.
- name
Regex String - A regex string to filter results by Image Component name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - owner String
- Mirror component type. Valid values:
SELF
orALIYUN
. Possible values:- SELF: The custom image component you created.
- ALIYUN: System components provided by Alibaba Cloud.
- resource
Group StringId - The ID of the resource group.
- Map<String,String>
- A mapping of tags to assign to the resource.
- ids string[]
- A list of Image Component IDs.
- image
Component stringName - The name of the component.
- name
Regex string - A regex string to filter results by Image Component name.
- output
File string - File name where to save data source results (after running
pulumi preview
). - owner string
- Mirror component type. Valid values:
SELF
orALIYUN
. Possible values:- SELF: The custom image component you created.
- ALIYUN: System components provided by Alibaba Cloud.
- resource
Group stringId - The ID of the resource group.
- {[key: string]: string}
- A mapping of tags to assign to the resource.
- ids Sequence[str]
- A list of Image Component IDs.
- image_
component_ strname - The name of the 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
- Mirror component type. Valid values:
SELF
orALIYUN
. Possible values:- SELF: The custom image component you created.
- ALIYUN: System components provided by Alibaba Cloud.
- resource_
group_ strid - The ID of the resource group.
- Mapping[str, str]
- A mapping of tags to assign to the resource.
- ids List<String>
- A list of Image Component IDs.
- image
Component StringName - The name of the component.
- name
Regex String - A regex string to filter results by Image Component name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - owner String
- Mirror component type. Valid values:
SELF
orALIYUN
. Possible values:- SELF: The custom image component you created.
- ALIYUN: System components provided by Alibaba Cloud.
- resource
Group StringId - The ID of the resource group.
- Map<String>
- A mapping of tags to assign to the resource.
getEcsImageComponents Result
The following output properties are available:
- Components
List<Pulumi.
Ali Cloud. Ecs. Outputs. Get Ecs Image Components Component> - Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- Names List<string>
- Image
Component stringName - Name
Regex string - Output
File string - Owner string
- Resource
Group stringId - Dictionary<string, string>
- Components
[]Get
Ecs Image Components Component - Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Names []string
- Image
Component stringName - Name
Regex string - Output
File string - Owner string
- Resource
Group stringId - map[string]string
- components
List<Get
Ecs Image Components Component> - id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- image
Component StringName - name
Regex String - output
File String - owner String
- resource
Group StringId - Map<String,String>
- components
Get
Ecs Image Components Component[] - id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- names string[]
- image
Component stringName - name
Regex string - output
File string - owner string
- resource
Group stringId - {[key: string]: string}
- components
Sequence[Get
Ecs Image Components Component] - id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- names Sequence[str]
- image_
component_ strname - name_
regex str - output_
file str - owner str
- resource_
group_ strid - Mapping[str, str]
- components List<Property Map>
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- image
Component StringName - name
Regex String - output
File String - owner String
- resource
Group StringId - Map<String>
Supporting Types
GetEcsImageComponentsComponent
- Component
Type string - The type of the image component.
- Content string
- The content of the image component.
- Create
Time 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.
- Image
Component stringId - The ID of the image component.
- Image
Component stringName - The name of the image component.
- Owner string
- The type of the image component.
- Resource
Group stringId - The ID of the resource group.
- System
Type string - The operating system type supported by the image component.
- Dictionary<string, string>
- List of label key-value pairs.
- Component
Type string - The type of the image component.
- Content string
- The content of the image component.
- Create
Time 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.
- Image
Component stringId - The ID of the image component.
- Image
Component stringName - The name of the image component.
- Owner string
- The type of the image component.
- Resource
Group stringId - The ID of the resource group.
- System
Type string - The operating system type supported by the image component.
- map[string]string
- List of label key-value pairs.
- component
Type String - The type of the image component.
- content String
- The content of the image component.
- create
Time 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.
- image
Component StringId - The ID of the image component.
- image
Component StringName - The name of the image component.
- owner String
- The type of the image component.
- resource
Group StringId - The ID of the resource group.
- system
Type String - The operating system type supported by the image component.
- Map<String,String>
- List of label key-value pairs.
- component
Type string - The type of the image component.
- content string
- The content of the image component.
- create
Time 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.
- image
Component stringId - The ID of the image component.
- image
Component stringName - The name of the image component.
- owner string
- The type of the image component.
- resource
Group stringId - The ID of the resource group.
- system
Type string - The operating system type supported by the image component.
- {[key: string]: string}
- 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_ strid - The ID of the image component.
- image_
component_ strname - The name of the image component.
- owner str
- The type of the image component.
- resource_
group_ strid - The ID of the resource group.
- system_
type str - The operating system type supported by the image component.
- Mapping[str, str]
- List of label key-value pairs.
- component
Type String - The type of the image component.
- content String
- The content of the image component.
- create
Time 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.
- image
Component StringId - The ID of the image component.
- image
Component StringName - The name of the image component.
- owner String
- The type of the image component.
- resource
Group StringId - The ID of the resource group.
- system
Type String - The operating system type supported by the image component.
- Map<String>
- 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.