ContainerGroupArgs

data class ContainerGroupArgs(val acrRegistryInfos: Output<List<ContainerGroupAcrRegistryInfoArgs>>? = null, val autoCreateEip: Output<Boolean>? = null, val autoMatchImageCache: Output<Boolean>? = null, val containerGroupName: Output<String>? = null, val containers: Output<List<ContainerGroupContainerArgs>>? = null, val cpu: Output<Double>? = null, val dnsConfig: Output<ContainerGroupDnsConfigArgs>? = null, val eciSecurityContext: Output<ContainerGroupEciSecurityContextArgs>? = null, val eipBandwidth: Output<Int>? = null, val eipInstanceId: Output<String>? = null, val hostAliases: Output<List<ContainerGroupHostAliasArgs>>? = null, val imageRegistryCredentials: Output<List<ContainerGroupImageRegistryCredentialArgs>>? = null, val initContainers: Output<List<ContainerGroupInitContainerArgs>>? = null, val insecureRegistry: Output<String>? = null, val instanceType: Output<String>? = null, val memory: Output<Double>? = null, val plainHttpRegistry: Output<String>? = null, val ramRoleName: Output<String>? = null, val resourceGroupId: Output<String>? = null, val restartPolicy: Output<String>? = null, val securityGroupId: Output<String>? = null, val tags: Output<Map<String, Any>>? = null, val volumes: Output<List<ContainerGroupVolumeArgs>>? = null, val vswitchId: Output<String>? = null, val zoneId: Output<String>? = null) : ConvertibleToJava<ContainerGroupArgs>

Provides ECI Container Group resource. For information about ECI Container Group and how to use it, see What is Container Group.

NOTE: Available in v1.111.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.eci.ContainerGroup;
import com.pulumi.alicloud.eci.ContainerGroupArgs;
import com.pulumi.alicloud.eci.inputs.ContainerGroupContainerArgs;
import com.pulumi.alicloud.eci.inputs.ContainerGroupInitContainerArgs;
import com.pulumi.alicloud.eci.inputs.ContainerGroupVolumeArgs;
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) {
var example = new ContainerGroup("example", ContainerGroupArgs.builder()
.containerGroupName("tf-testacc-eci-gruop")
.cpu(8)
.memory(16)
.restartPolicy("OnFailure")
.securityGroupId(alicloud_security_group.group().id())
.vswitchId(data.alicloud_vpcs().default().vpcs()[0].vswitch_ids()[0])
.tags(Map.of("TF", "create"))
.containers(
ContainerGroupContainerArgs.builder()
.image("registry-vpc.cn-beijing.aliyuncs.com/eci_open/nginx:alpine")
.name("nginx")
.workingDir("/tmp/nginx")
.imagePullPolicy("IfNotPresent")
.commands(
"/bin/sh",
"-c",
"sleep 9999")
.volumeMounts(ContainerGroupContainerVolumeMountArgs.builder()
.mountPath("/tmp/test")
.readOnly(false)
.name("empty1")
.build())
.ports(ContainerGroupContainerPortArgs.builder()
.port(80)
.protocol("TCP")
.build())
.environmentVars(ContainerGroupContainerEnvironmentVarArgs.builder()
.key("test")
.value("nginx")
.build())
.livenessProbes(ContainerGroupContainerLivenessProbeArgs.builder()
.periodSeconds("5")
.initialDelaySeconds("5")
.successThreshold("1")
.failureThreshold("3")
.timeoutSeconds("1")
.execs(ContainerGroupContainerLivenessProbeExecArgs.builder()
.commands("cat /tmp/healthy")
.build())
.build())
.readinessProbes(ContainerGroupContainerReadinessProbeArgs.builder()
.periodSeconds("5")
.initialDelaySeconds("5")
.successThreshold("1")
.failureThreshold("3")
.timeoutSeconds("1")
.execs(ContainerGroupContainerReadinessProbeExecArgs.builder()
.commands("cat /tmp/healthy")
.build())
.build())
.build(),
ContainerGroupContainerArgs.builder()
.image("registry-vpc.cn-beijing.aliyuncs.com/eci_open/centos:7")
.name("centos")
.commands(
"/bin/sh",
"-c",
"sleep 9999")
.build())
.initContainers(ContainerGroupInitContainerArgs.builder()
.name("init-busybox")
.image("registry-vpc.cn-beijing.aliyuncs.com/eci_open/busybox:1.30")
.imagePullPolicy("IfNotPresent")
.commands("echo")
.args("hello initcontainer")
.build())
.volumes(
ContainerGroupVolumeArgs.builder()
.name("empty1")
.type("EmptyDirVolume")
.build(),
ContainerGroupVolumeArgs.builder()
.name("empty2")
.type("EmptyDirVolume")
.build())
.build());
}
}

Import

ECI Container Group can be imported using the id, e.g.

$ pulumi import alicloud:eci/containerGroup:ContainerGroup example <container_group_id>

Constructors

Link copied to clipboard
fun ContainerGroupArgs(acrRegistryInfos: Output<List<ContainerGroupAcrRegistryInfoArgs>>? = null, autoCreateEip: Output<Boolean>? = null, autoMatchImageCache: Output<Boolean>? = null, containerGroupName: Output<String>? = null, containers: Output<List<ContainerGroupContainerArgs>>? = null, cpu: Output<Double>? = null, dnsConfig: Output<ContainerGroupDnsConfigArgs>? = null, eciSecurityContext: Output<ContainerGroupEciSecurityContextArgs>? = null, eipBandwidth: Output<Int>? = null, eipInstanceId: Output<String>? = null, hostAliases: Output<List<ContainerGroupHostAliasArgs>>? = null, imageRegistryCredentials: Output<List<ContainerGroupImageRegistryCredentialArgs>>? = null, initContainers: Output<List<ContainerGroupInitContainerArgs>>? = null, insecureRegistry: Output<String>? = null, instanceType: Output<String>? = null, memory: Output<Double>? = null, plainHttpRegistry: Output<String>? = null, ramRoleName: Output<String>? = null, resourceGroupId: Output<String>? = null, restartPolicy: Output<String>? = null, securityGroupId: Output<String>? = null, tags: Output<Map<String, Any>>? = null, volumes: Output<List<ContainerGroupVolumeArgs>>? = null, vswitchId: Output<String>? = null, zoneId: Output<String>? = null)

Functions

Link copied to clipboard
open override fun toJava(): ContainerGroupArgs

Properties

Link copied to clipboard

The ACR enterprise edition example properties.

Link copied to clipboard
val autoCreateEip: Output<Boolean>? = null

Specifies whether to automatically create an EIP and bind the EIP to the elastic container instance.

Link copied to clipboard
val autoMatchImageCache: Output<Boolean>? = null

Specifies whether to automatically match the image cache. Default value: false.

Link copied to clipboard
val containerGroupName: Output<String>? = null

The name of the container group.

Link copied to clipboard

The list of containers.

Link copied to clipboard
val cpu: Output<Double>? = null

The amount of CPU resources allocated to the container group.

Link copied to clipboard

The structure of dnsConfig.

Link copied to clipboard

The security context of the container group.

Link copied to clipboard
val eipBandwidth: Output<Int>? = null

The bandwidth of the EIP. The default value is 5.

Link copied to clipboard
val eipInstanceId: Output<String>? = null

The ID of the elastic IP address (EIP).

Link copied to clipboard

HostAliases.

Link copied to clipboard

The image registry credential. The details see Block image_registry_credential.

Link copied to clipboard

The list of initContainers.

Link copied to clipboard
val insecureRegistry: Output<String>? = null

The address of the self-built mirror warehouse. When creating an image cache using an image in a self-built image repository with a self-signed certificate, you need to configure this parameter to skip certificate authentication to avoid image pull failure due to certificate authentication failure.

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

The type of the ECS instance.

Link copied to clipboard
val memory: Output<Double>? = null

The amount of memory resources allocated to the container group.

Link copied to clipboard
val plainHttpRegistry: Output<String>? = null

The address of the self-built mirror warehouse. When creating an image cache from an image in a self-built image repository using the HTTP protocol, you need to configure this parameter so that the ECI uses the HTTP protocol to pull the image to avoid image pull failure due to different protocols.

Link copied to clipboard
val ramRoleName: Output<String>? = null

The RAM role that the container group assumes. ECI and ECS share the same RAM role.

Link copied to clipboard
val resourceGroupId: Output<String>? = null

The ID of the resource group.

Link copied to clipboard
val restartPolicy: Output<String>? = null

The restart policy of the container group. Valid values: Always, Never, OnFailure.

Link copied to clipboard
val securityGroupId: Output<String>? = null

The ID of the security group to which the container group belongs. Container groups within the same security group can access each other.

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

A mapping of tags to assign to the resource.

Link copied to clipboard
val volumes: Output<List<ContainerGroupVolumeArgs>>? = null

The list of volumes.

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

The ID of the VSwitch. Currently, container groups can only be deployed in VPC networks. The number of IP addresses in the VSwitch CIDR block determines the maximum number of container groups that can be created in the VSwitch. Before you can create an ECI instance, plan the CIDR block of the VSwitch.

Link copied to clipboard
val zoneId: Output<String>? = null

The ID of the zone where you want to deploy the container group. If no value is specified, the system assigns a zone to the container group. By default, no value is specified.