1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. ecs
  5. EcsImageComponent
Alibaba Cloud v3.52.1 published on Thursday, Apr 4, 2024 by Pulumi

alicloud.ecs.EcsImageComponent

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.52.1 published on Thursday, Apr 4, 2024 by Pulumi

    Provides a Ecs Image Component resource.

    For information about Ecs Image Component and how to use it, see What is Image Component.

    NOTE: Available since v1.159.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const default = alicloud.resourcemanager.getResourceGroups({
        nameRegex: "default",
    });
    const example = new alicloud.ecs.EcsImageComponent("example", {
        componentType: "Build",
        content: "RUN yum update -y",
        description: "example_value",
        imageComponentName: "example_value",
        resourceGroupId: _default.then(_default => _default.groups?.[0]?.id),
        systemType: "Linux",
        tags: {
            Created: "TF",
        },
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default = alicloud.resourcemanager.get_resource_groups(name_regex="default")
    example = alicloud.ecs.EcsImageComponent("example",
        component_type="Build",
        content="RUN yum update -y",
        description="example_value",
        image_component_name="example_value",
        resource_group_id=default.groups[0].id,
        system_type="Linux",
        tags={
            "Created": "TF",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/resourcemanager"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_default, err := resourcemanager.GetResourceGroups(ctx, &resourcemanager.GetResourceGroupsArgs{
    			NameRegex: pulumi.StringRef("default"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = ecs.NewEcsImageComponent(ctx, "example", &ecs.EcsImageComponentArgs{
    			ComponentType:      pulumi.String("Build"),
    			Content:            pulumi.String("RUN yum update -y"),
    			Description:        pulumi.String("example_value"),
    			ImageComponentName: pulumi.String("example_value"),
    			ResourceGroupId:    pulumi.String(_default.Groups[0].Id),
    			SystemType:         pulumi.String("Linux"),
    			Tags: pulumi.Map{
    				"Created": pulumi.Any("TF"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = AliCloud.ResourceManager.GetResourceGroups.Invoke(new()
        {
            NameRegex = "default",
        });
    
        var example = new AliCloud.Ecs.EcsImageComponent("example", new()
        {
            ComponentType = "Build",
            Content = "RUN yum update -y",
            Description = "example_value",
            ImageComponentName = "example_value",
            ResourceGroupId = @default.Apply(@default => @default.Apply(getResourceGroupsResult => getResourceGroupsResult.Groups[0]?.Id)),
            SystemType = "Linux",
            Tags = 
            {
                { "Created", "TF" },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.resourcemanager.ResourcemanagerFunctions;
    import com.pulumi.alicloud.resourcemanager.inputs.GetResourceGroupsArgs;
    import com.pulumi.alicloud.ecs.EcsImageComponent;
    import com.pulumi.alicloud.ecs.EcsImageComponentArgs;
    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 default = ResourcemanagerFunctions.getResourceGroups(GetResourceGroupsArgs.builder()
                .nameRegex("default")
                .build());
    
            var example = new EcsImageComponent("example", EcsImageComponentArgs.builder()        
                .componentType("Build")
                .content("RUN yum update -y")
                .description("example_value")
                .imageComponentName("example_value")
                .resourceGroupId(default_.groups()[0].id())
                .systemType("Linux")
                .tags(Map.of("Created", "TF"))
                .build());
    
        }
    }
    
    resources:
      example:
        type: alicloud:ecs:EcsImageComponent
        properties:
          componentType: Build
          content: RUN yum update -y
          description: example_value
          imageComponentName: example_value
          resourceGroupId: ${default.groups[0].id}
          systemType: Linux
          tags:
            Created: TF
    variables:
      default:
        fn::invoke:
          Function: alicloud:resourcemanager:getResourceGroups
          Arguments:
            nameRegex: default
    

    Create EcsImageComponent Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new EcsImageComponent(name: string, args: EcsImageComponentArgs, opts?: CustomResourceOptions);
    @overload
    def EcsImageComponent(resource_name: str,
                          args: EcsImageComponentArgs,
                          opts: Optional[ResourceOptions] = None)
    
    @overload
    def EcsImageComponent(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          content: Optional[str] = None,
                          component_type: Optional[str] = None,
                          description: Optional[str] = None,
                          image_component_name: Optional[str] = None,
                          resource_group_id: Optional[str] = None,
                          system_type: Optional[str] = None,
                          tags: Optional[Mapping[str, Any]] = None)
    func NewEcsImageComponent(ctx *Context, name string, args EcsImageComponentArgs, opts ...ResourceOption) (*EcsImageComponent, error)
    public EcsImageComponent(string name, EcsImageComponentArgs args, CustomResourceOptions? opts = null)
    public EcsImageComponent(String name, EcsImageComponentArgs args)
    public EcsImageComponent(String name, EcsImageComponentArgs args, CustomResourceOptions options)
    
    type: alicloud:ecs:EcsImageComponent
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args EcsImageComponentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args EcsImageComponentArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args EcsImageComponentArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args EcsImageComponentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args EcsImageComponentArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var ecsImageComponentResource = new AliCloud.Ecs.EcsImageComponent("ecsImageComponentResource", new()
    {
        Content = "string",
        ComponentType = "string",
        Description = "string",
        ImageComponentName = "string",
        ResourceGroupId = "string",
        SystemType = "string",
        Tags = 
        {
            { "string", "any" },
        },
    });
    
    example, err := ecs.NewEcsImageComponent(ctx, "ecsImageComponentResource", &ecs.EcsImageComponentArgs{
    	Content:            pulumi.String("string"),
    	ComponentType:      pulumi.String("string"),
    	Description:        pulumi.String("string"),
    	ImageComponentName: pulumi.String("string"),
    	ResourceGroupId:    pulumi.String("string"),
    	SystemType:         pulumi.String("string"),
    	Tags: pulumi.Map{
    		"string": pulumi.Any("any"),
    	},
    })
    
    var ecsImageComponentResource = new EcsImageComponent("ecsImageComponentResource", EcsImageComponentArgs.builder()        
        .content("string")
        .componentType("string")
        .description("string")
        .imageComponentName("string")
        .resourceGroupId("string")
        .systemType("string")
        .tags(Map.of("string", "any"))
        .build());
    
    ecs_image_component_resource = alicloud.ecs.EcsImageComponent("ecsImageComponentResource",
        content="string",
        component_type="string",
        description="string",
        image_component_name="string",
        resource_group_id="string",
        system_type="string",
        tags={
            "string": "any",
        })
    
    const ecsImageComponentResource = new alicloud.ecs.EcsImageComponent("ecsImageComponentResource", {
        content: "string",
        componentType: "string",
        description: "string",
        imageComponentName: "string",
        resourceGroupId: "string",
        systemType: "string",
        tags: {
            string: "any",
        },
    });
    
    type: alicloud:ecs:EcsImageComponent
    properties:
        componentType: string
        content: string
        description: string
        imageComponentName: string
        resourceGroupId: string
        systemType: string
        tags:
            string: any
    

    EcsImageComponent Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The EcsImageComponent resource accepts the following input properties:

    Content string
    Component content.
    ComponentType string
    The component type. Currently, only mirror build components are supported. Value: Build. Default value: Build.
    Description string
    Describe the information.
    ImageComponentName string
    The component name. The name must be 2 to 128 characters in length and must start with an uppercase letter or a Chinese character. It cannot start with http:// or https. Can contain Chinese, English, numbers, half-length colons (:), underscores (_), half-length periods (.), or dashes (-). Note: If Name is not set, the return value of ImageComponentId is used by default.
    ResourceGroupId string
    The ID of the resource group.
    SystemType string
    The operating system supported by the component. Currently, only Linux systems are supported. Value: Linux. Default value: Linux.
    Tags Dictionary<string, object>
    List of label key-value pairs.
    Content string
    Component content.
    ComponentType string
    The component type. Currently, only mirror build components are supported. Value: Build. Default value: Build.
    Description string
    Describe the information.
    ImageComponentName string
    The component name. The name must be 2 to 128 characters in length and must start with an uppercase letter or a Chinese character. It cannot start with http:// or https. Can contain Chinese, English, numbers, half-length colons (:), underscores (_), half-length periods (.), or dashes (-). Note: If Name is not set, the return value of ImageComponentId is used by default.
    ResourceGroupId string
    The ID of the resource group.
    SystemType string
    The operating system supported by the component. Currently, only Linux systems are supported. Value: Linux. Default value: Linux.
    Tags map[string]interface{}
    List of label key-value pairs.
    content String
    Component content.
    componentType String
    The component type. Currently, only mirror build components are supported. Value: Build. Default value: Build.
    description String
    Describe the information.
    imageComponentName String
    The component name. The name must be 2 to 128 characters in length and must start with an uppercase letter or a Chinese character. It cannot start with http:// or https. Can contain Chinese, English, numbers, half-length colons (:), underscores (_), half-length periods (.), or dashes (-). Note: If Name is not set, the return value of ImageComponentId is used by default.
    resourceGroupId String
    The ID of the resource group.
    systemType String
    The operating system supported by the component. Currently, only Linux systems are supported. Value: Linux. Default value: Linux.
    tags Map<String,Object>
    List of label key-value pairs.
    content string
    Component content.
    componentType string
    The component type. Currently, only mirror build components are supported. Value: Build. Default value: Build.
    description string
    Describe the information.
    imageComponentName string
    The component name. The name must be 2 to 128 characters in length and must start with an uppercase letter or a Chinese character. It cannot start with http:// or https. Can contain Chinese, English, numbers, half-length colons (:), underscores (_), half-length periods (.), or dashes (-). Note: If Name is not set, the return value of ImageComponentId is used by default.
    resourceGroupId string
    The ID of the resource group.
    systemType string
    The operating system supported by the component. Currently, only Linux systems are supported. Value: Linux. Default value: Linux.
    tags {[key: string]: any}
    List of label key-value pairs.
    content str
    Component content.
    component_type str
    The component type. Currently, only mirror build components are supported. Value: Build. Default value: Build.
    description str
    Describe the information.
    image_component_name str
    The component name. The name must be 2 to 128 characters in length and must start with an uppercase letter or a Chinese character. It cannot start with http:// or https. Can contain Chinese, English, numbers, half-length colons (:), underscores (_), half-length periods (.), or dashes (-). Note: If Name is not set, the return value of ImageComponentId is used by default.
    resource_group_id str
    The ID of the resource group.
    system_type str
    The operating system supported by the component. Currently, only Linux systems are supported. Value: Linux. Default value: Linux.
    tags Mapping[str, Any]
    List of label key-value pairs.
    content String
    Component content.
    componentType String
    The component type. Currently, only mirror build components are supported. Value: Build. Default value: Build.
    description String
    Describe the information.
    imageComponentName String
    The component name. The name must be 2 to 128 characters in length and must start with an uppercase letter or a Chinese character. It cannot start with http:// or https. Can contain Chinese, English, numbers, half-length colons (:), underscores (_), half-length periods (.), or dashes (-). Note: If Name is not set, the return value of ImageComponentId is used by default.
    resourceGroupId String
    The ID of the resource group.
    systemType String
    The operating system supported by the component. Currently, only Linux systems are supported. Value: Linux. Default value: Linux.
    tags Map<Any>
    List of label key-value pairs.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the EcsImageComponent resource produces the following output properties:

    CreateTime string
    Component creation time.
    Id string
    The provider-assigned unique ID for this managed resource.
    CreateTime string
    Component creation time.
    Id string
    The provider-assigned unique ID for this managed resource.
    createTime String
    Component creation time.
    id String
    The provider-assigned unique ID for this managed resource.
    createTime string
    Component creation time.
    id string
    The provider-assigned unique ID for this managed resource.
    create_time str
    Component creation time.
    id str
    The provider-assigned unique ID for this managed resource.
    createTime String
    Component creation time.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing EcsImageComponent Resource

    Get an existing EcsImageComponent resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: EcsImageComponentState, opts?: CustomResourceOptions): EcsImageComponent
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            component_type: Optional[str] = None,
            content: Optional[str] = None,
            create_time: Optional[str] = None,
            description: Optional[str] = None,
            image_component_name: Optional[str] = None,
            resource_group_id: Optional[str] = None,
            system_type: Optional[str] = None,
            tags: Optional[Mapping[str, Any]] = None) -> EcsImageComponent
    func GetEcsImageComponent(ctx *Context, name string, id IDInput, state *EcsImageComponentState, opts ...ResourceOption) (*EcsImageComponent, error)
    public static EcsImageComponent Get(string name, Input<string> id, EcsImageComponentState? state, CustomResourceOptions? opts = null)
    public static EcsImageComponent get(String name, Output<String> id, EcsImageComponentState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    ComponentType string
    The component type. Currently, only mirror build components are supported. Value: Build. Default value: Build.
    Content string
    Component content.
    CreateTime string
    Component creation time.
    Description string
    Describe the information.
    ImageComponentName string
    The component name. The name must be 2 to 128 characters in length and must start with an uppercase letter or a Chinese character. It cannot start with http:// or https. Can contain Chinese, English, numbers, half-length colons (:), underscores (_), half-length periods (.), or dashes (-). Note: If Name is not set, the return value of ImageComponentId is used by default.
    ResourceGroupId string
    The ID of the resource group.
    SystemType string
    The operating system supported by the component. Currently, only Linux systems are supported. Value: Linux. Default value: Linux.
    Tags Dictionary<string, object>
    List of label key-value pairs.
    ComponentType string
    The component type. Currently, only mirror build components are supported. Value: Build. Default value: Build.
    Content string
    Component content.
    CreateTime string
    Component creation time.
    Description string
    Describe the information.
    ImageComponentName string
    The component name. The name must be 2 to 128 characters in length and must start with an uppercase letter or a Chinese character. It cannot start with http:// or https. Can contain Chinese, English, numbers, half-length colons (:), underscores (_), half-length periods (.), or dashes (-). Note: If Name is not set, the return value of ImageComponentId is used by default.
    ResourceGroupId string
    The ID of the resource group.
    SystemType string
    The operating system supported by the component. Currently, only Linux systems are supported. Value: Linux. Default value: Linux.
    Tags map[string]interface{}
    List of label key-value pairs.
    componentType String
    The component type. Currently, only mirror build components are supported. Value: Build. Default value: Build.
    content String
    Component content.
    createTime String
    Component creation time.
    description String
    Describe the information.
    imageComponentName String
    The component name. The name must be 2 to 128 characters in length and must start with an uppercase letter or a Chinese character. It cannot start with http:// or https. Can contain Chinese, English, numbers, half-length colons (:), underscores (_), half-length periods (.), or dashes (-). Note: If Name is not set, the return value of ImageComponentId is used by default.
    resourceGroupId String
    The ID of the resource group.
    systemType String
    The operating system supported by the component. Currently, only Linux systems are supported. Value: Linux. Default value: Linux.
    tags Map<String,Object>
    List of label key-value pairs.
    componentType string
    The component type. Currently, only mirror build components are supported. Value: Build. Default value: Build.
    content string
    Component content.
    createTime string
    Component creation time.
    description string
    Describe the information.
    imageComponentName string
    The component name. The name must be 2 to 128 characters in length and must start with an uppercase letter or a Chinese character. It cannot start with http:// or https. Can contain Chinese, English, numbers, half-length colons (:), underscores (_), half-length periods (.), or dashes (-). Note: If Name is not set, the return value of ImageComponentId is used by default.
    resourceGroupId string
    The ID of the resource group.
    systemType string
    The operating system supported by the component. Currently, only Linux systems are supported. Value: Linux. Default value: Linux.
    tags {[key: string]: any}
    List of label key-value pairs.
    component_type str
    The component type. Currently, only mirror build components are supported. Value: Build. Default value: Build.
    content str
    Component content.
    create_time str
    Component creation time.
    description str
    Describe the information.
    image_component_name str
    The component name. The name must be 2 to 128 characters in length and must start with an uppercase letter or a Chinese character. It cannot start with http:// or https. Can contain Chinese, English, numbers, half-length colons (:), underscores (_), half-length periods (.), or dashes (-). Note: If Name is not set, the return value of ImageComponentId is used by default.
    resource_group_id str
    The ID of the resource group.
    system_type str
    The operating system supported by the component. Currently, only Linux systems are supported. Value: Linux. Default value: Linux.
    tags Mapping[str, Any]
    List of label key-value pairs.
    componentType String
    The component type. Currently, only mirror build components are supported. Value: Build. Default value: Build.
    content String
    Component content.
    createTime String
    Component creation time.
    description String
    Describe the information.
    imageComponentName String
    The component name. The name must be 2 to 128 characters in length and must start with an uppercase letter or a Chinese character. It cannot start with http:// or https. Can contain Chinese, English, numbers, half-length colons (:), underscores (_), half-length periods (.), or dashes (-). Note: If Name is not set, the return value of ImageComponentId is used by default.
    resourceGroupId String
    The ID of the resource group.
    systemType String
    The operating system supported by the component. Currently, only Linux systems are supported. Value: Linux. Default value: Linux.
    tags Map<Any>
    List of label key-value pairs.

    Import

    Ecs Image Component can be imported using the id, e.g.

    $ pulumi import alicloud:ecs/ecsImageComponent:EcsImageComponent example <id>
    

    To learn more about importing existing cloud resources, see Importing resources.

    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.52.1 published on Thursday, Apr 4, 2024 by Pulumi