EcsImagePipeline

class EcsImagePipeline : KotlinCustomResource

Provides a ECS Image Pipeline resource. For information about ECS Image Pipeline and how to use it, see What is Image Pipeline.

NOTE: Available in v1.163.0+.

Example Usage

Basic Usage

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.AlicloudFunctions;
import com.pulumi.alicloud.inputs.GetZonesArgs;
import com.pulumi.alicloud.ecs.EcsFunctions;
import com.pulumi.alicloud.ecs.inputs.GetImagesArgs;
import com.pulumi.alicloud.ecs.inputs.GetInstanceTypesArgs;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.vpc.Switch;
import com.pulumi.alicloud.vpc.SwitchArgs;
import com.pulumi.alicloud.ecs.EcsImagePipeline;
import com.pulumi.alicloud.ecs.EcsImagePipelineArgs;
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 defaultResourceGroups = ResourcemanagerFunctions.getResourceGroups(GetResourceGroupsArgs.builder()
.nameRegex("default")
.build());
final var defaultZones = AlicloudFunctions.getZones(GetZonesArgs.builder()
.availableResourceCreation("VSwitch")
.build());
final var defaultImages = EcsFunctions.getImages(GetImagesArgs.builder()
.nameRegex("^ubuntu_[0-9]+_[0-9]+_x64*")
.mostRecent(true)
.owners("system")
.build());
final var defaultInstanceTypes = EcsFunctions.getInstanceTypes(GetInstanceTypesArgs.builder()
.imageId(defaultImages.applyValue(getImagesResult -> getImagesResult.ids()[0]))
.build());
final var defaultAccount = AlicloudFunctions.getAccount();
var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
.vpcName("terraform-example")
.cidrBlock("172.17.3.0/24")
.build());
var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()
.vswitchName("terraform-example")
.cidrBlock("172.17.3.0/24")
.vpcId(defaultNetwork.id())
.zoneId(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
.build());
var defaultEcsImagePipeline = new EcsImagePipeline("defaultEcsImagePipeline", EcsImagePipelineArgs.builder()
.addAccounts(defaultAccount.applyValue(getAccountResult -> getAccountResult.id()))
.baseImage(defaultImages.applyValue(getImagesResult -> getImagesResult.ids()[0]))
.baseImageType("IMAGE")
.buildContent("RUN yum update -y")
.deleteInstanceOnFailure(false)
.imageName("terraform-example")
.description("terraform-example")
.instanceType(defaultInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.ids()[0]))
.resourceGroupId(defaultResourceGroups.applyValue(getResourceGroupsResult -> getResourceGroupsResult.groups()[0].id()))
.internetMaxBandwidthOut(20)
.systemDiskSize(40)
.toRegionIds(
"cn-qingdao",
"cn-zhangjiakou")
.vswitchId(defaultSwitch.id())
.tags(Map.ofEntries(
Map.entry("Created", "TF"),
Map.entry("For", "Acceptance-test")
))
.build());
}
}

Import

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

$ pulumi import alicloud:ecs/ecsImagePipeline:EcsImagePipeline example <id>

Properties

Link copied to clipboard
val addAccounts: Output<List<String>>?

The ID of Alibaba Cloud account to which to share the created image.

Link copied to clipboard
val baseImage: Output<String>

The source image. When you set base_image_type to IMAGE, set base_image to the ID of a custom image. When you set base_image_type to IMAGE_FAMILY, set base_image to the name of an image family.

Link copied to clipboard
val baseImageType: Output<String>

The type of the source image. Valid values: IMAGE, IMAGE_FAMILY.

Link copied to clipboard
val buildContent: Output<String>?

The content of the image template. The content cannot be greater than 16 KB in size, and can contain up to 127 commands.

Link copied to clipboard

Specifies whether to release the intermediate instance if the image cannot be created.

Link copied to clipboard
val description: Output<String>?

The description of the image template. The description must be 2 to 256 characters in length and cannot start with http:// or https://. Note: If the intermediate instance cannot be started, the instance is released by default.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val imageName: Output<String>?

The name prefix of the image to be created. The prefix must be 2 to 64 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 (-).

Link copied to clipboard
val instanceType: Output<String>?

The instance type of the instance. You can call the DescribeInstanceTypes operation to query instance types. If you do not specify this parameter, an instance type that provides the fewest vCPUs and memory resources is automatically selected. This configuration is subject to resource availability of instance types. For example, the ecs.g6.large instance type is selected by default. If available ecs.g6.large resources are insufficient, the ecs.g6.xlarge instance type is selected.

Link copied to clipboard

The size of the outbound public bandwidth for the intermediate instance. Unit: Mbit/s. Valid values: 0 to 100. Default value: 0.

Link copied to clipboard
val name: Output<String>

The name of the image template. 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 (-).

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val resourceGroupId: Output<String>

The ID of the resource group.

Link copied to clipboard
val systemDiskSize: Output<Int>

The size of the system disk of the intermediate instance. Unit: GiB. Valid values: 20 to 500. Default value: 40.

Link copied to clipboard
val tags: Output<Map<String, Any>>?

A mapping of tags to assign to the resource.

Link copied to clipboard
val toRegionIds: Output<List<String>>?

The ID of region to which to distribute the created image.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val vswitchId: Output<String>?

The ID of the vSwitch. If you do not specify this parameter, a virtual private cloud (VPC) and a vSwitch are created by default.