Alibaba Cloud

v3.28.0 published on Tuesday, Aug 16, 2022 by Pulumi

EcsImageComponent

Provides a ECS Image Component resource.

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

NOTE: Available in v1.159.0+.

Example Usage

Basic Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var @default = Output.Create(AliCloud.ResourceManager.GetResourceGroups.InvokeAsync(new AliCloud.ResourceManager.GetResourceGroupsArgs
        {
            NameRegex = "default",
        }));
        var example = new AliCloud.Ecs.EcsImageComponent("example", new AliCloud.Ecs.EcsImageComponentArgs
        {
            ComponentType = "Build",
            Content = "RUN yum update -y",
            Description = "example_value",
            ImageComponentName = "example_value",
            ResourceGroupId = @default.Apply(@default => @default.Groups?[0]?.Id),
            SystemType = "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.AnyMap{
				"Created": pulumi.Any("TF"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
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());

    }
}
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",
    })
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",
    },
});
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

new EcsImageComponent(name: string, args: EcsImageComponentArgs, opts?: CustomResourceOptions);
@overload
def EcsImageComponent(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      component_type: Optional[str] = None,
                      content: 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)
@overload
def EcsImageComponent(resource_name: str,
                      args: EcsImageComponentArgs,
                      opts: Optional[ResourceOptions] = 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.

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.

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

The content of the image component. The content can consist of up to 127 commands.

ComponentType string

The type of the image component. Only image building components are supported. Valid values: Build.

Description string

The description of the image component. The description must be 2 to 256 characters in length and cannot start with http:// or https://.

ImageComponentName string

The name of the image component. The name must be 2 to 128 characters in length. It must start with a letter and cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), periods (.), and hyphens (-).

ResourceGroupId string

The ID of the resource group to which to assign the image component.

SystemType string

The operating system type supported by the image component. Only Linux is supported. Valid values: Linux.

Tags Dictionary<string, object>

A mapping of tags to assign to the resource.

Content string

The content of the image component. The content can consist of up to 127 commands.

ComponentType string

The type of the image component. Only image building components are supported. Valid values: Build.

Description string

The description of the image component. The description must be 2 to 256 characters in length and cannot start with http:// or https://.

ImageComponentName string

The name of the image component. The name must be 2 to 128 characters in length. It must start with a letter and cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), periods (.), and hyphens (-).

ResourceGroupId string

The ID of the resource group to which to assign the image component.

SystemType string

The operating system type supported by the image component. Only Linux is supported. Valid values: Linux.

Tags map[string]interface{}

A mapping of tags to assign to the resource.

content String

The content of the image component. The content can consist of up to 127 commands.

componentType String

The type of the image component. Only image building components are supported. Valid values: Build.

description String

The description of the image component. The description must be 2 to 256 characters in length and cannot start with http:// or https://.

imageComponentName String

The name of the image component. The name must be 2 to 128 characters in length. It must start with a letter and cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), periods (.), and hyphens (-).

resourceGroupId String

The ID of the resource group to which to assign the image component.

systemType String

The operating system type supported by the image component. Only Linux is supported. Valid values: Linux.

tags Map<String,Object>

A mapping of tags to assign to the resource.

content string

The content of the image component. The content can consist of up to 127 commands.

componentType string

The type of the image component. Only image building components are supported. Valid values: Build.

description string

The description of the image component. The description must be 2 to 256 characters in length and cannot start with http:// or https://.

imageComponentName string

The name of the image component. The name must be 2 to 128 characters in length. It must start with a letter and cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), periods (.), and hyphens (-).

resourceGroupId string

The ID of the resource group to which to assign the image component.

systemType string

The operating system type supported by the image component. Only Linux is supported. Valid values: Linux.

tags {[key: string]: any}

A mapping of tags to assign to the resource.

content str

The content of the image component. The content can consist of up to 127 commands.

component_type str

The type of the image component. Only image building components are supported. Valid values: Build.

description str

The description of the image component. The description must be 2 to 256 characters in length and cannot start with http:// or https://.

image_component_name str

The name of the image component. The name must be 2 to 128 characters in length. It must start with a letter and cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), periods (.), and hyphens (-).

resource_group_id str

The ID of the resource group to which to assign the image component.

system_type str

The operating system type supported by the image component. Only Linux is supported. Valid values: Linux.

tags Mapping[str, Any]

A mapping of tags to assign to the resource.

content String

The content of the image component. The content can consist of up to 127 commands.

componentType String

The type of the image component. Only image building components are supported. Valid values: Build.

description String

The description of the image component. The description must be 2 to 256 characters in length and cannot start with http:// or https://.

imageComponentName String

The name of the image component. The name must be 2 to 128 characters in length. It must start with a letter and cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), periods (.), and hyphens (-).

resourceGroupId String

The ID of the resource group to which to assign the image component.

systemType String

The operating system type supported by the image component. Only Linux is supported. Valid values: Linux.

tags Map<Any>

A mapping of tags to assign to the resource.

Outputs

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

Id string

The provider-assigned unique ID for this managed resource.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

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,
        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 type of the image component. Only image building components are supported. Valid values: Build.

Content string

The content of the image component. The content can consist of up to 127 commands.

Description string

The description of the image component. The description must be 2 to 256 characters in length and cannot start with http:// or https://.

ImageComponentName string

The name of the image component. The name must be 2 to 128 characters in length. It must start with a letter and cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), periods (.), and hyphens (-).

ResourceGroupId string

The ID of the resource group to which to assign the image component.

SystemType string

The operating system type supported by the image component. Only Linux is supported. Valid values: Linux.

Tags Dictionary<string, object>

A mapping of tags to assign to the resource.

ComponentType string

The type of the image component. Only image building components are supported. Valid values: Build.

Content string

The content of the image component. The content can consist of up to 127 commands.

Description string

The description of the image component. The description must be 2 to 256 characters in length and cannot start with http:// or https://.

ImageComponentName string

The name of the image component. The name must be 2 to 128 characters in length. It must start with a letter and cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), periods (.), and hyphens (-).

ResourceGroupId string

The ID of the resource group to which to assign the image component.

SystemType string

The operating system type supported by the image component. Only Linux is supported. Valid values: Linux.

Tags map[string]interface{}

A mapping of tags to assign to the resource.

componentType String

The type of the image component. Only image building components are supported. Valid values: Build.

content String

The content of the image component. The content can consist of up to 127 commands.

description String

The description of the image component. The description must be 2 to 256 characters in length and cannot start with http:// or https://.

imageComponentName String

The name of the image component. The name must be 2 to 128 characters in length. It must start with a letter and cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), periods (.), and hyphens (-).

resourceGroupId String

The ID of the resource group to which to assign the image component.

systemType String

The operating system type supported by the image component. Only Linux is supported. Valid values: Linux.

tags Map<String,Object>

A mapping of tags to assign to the resource.

componentType string

The type of the image component. Only image building components are supported. Valid values: Build.

content string

The content of the image component. The content can consist of up to 127 commands.

description string

The description of the image component. The description must be 2 to 256 characters in length and cannot start with http:// or https://.

imageComponentName string

The name of the image component. The name must be 2 to 128 characters in length. It must start with a letter and cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), periods (.), and hyphens (-).

resourceGroupId string

The ID of the resource group to which to assign the image component.

systemType string

The operating system type supported by the image component. Only Linux is supported. Valid values: Linux.

tags {[key: string]: any}

A mapping of tags to assign to the resource.

component_type str

The type of the image component. Only image building components are supported. Valid values: Build.

content str

The content of the image component. The content can consist of up to 127 commands.

description str

The description of the image component. The description must be 2 to 256 characters in length and cannot start with http:// or https://.

image_component_name str

The name of the image component. The name must be 2 to 128 characters in length. It must start with a letter and cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), periods (.), and hyphens (-).

resource_group_id str

The ID of the resource group to which to assign the image component.

system_type str

The operating system type supported by the image component. Only Linux is supported. Valid values: Linux.

tags Mapping[str, Any]

A mapping of tags to assign to the resource.

componentType String

The type of the image component. Only image building components are supported. Valid values: Build.

content String

The content of the image component. The content can consist of up to 127 commands.

description String

The description of the image component. The description must be 2 to 256 characters in length and cannot start with http:// or https://.

imageComponentName String

The name of the image component. The name must be 2 to 128 characters in length. It must start with a letter and cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), periods (.), and hyphens (-).

resourceGroupId String

The ID of the resource group to which to assign the image component.

systemType String

The operating system type supported by the image component. Only Linux is supported. Valid values: Linux.

tags Map<Any>

A mapping of tags to assign to the resource.

Import

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

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

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.