Skip to content

ContainerGroup

This class encapsulates and extends the ROS resource type ALIYUN::ECI::ContainerGroup.

Initializers

import com.aliyun.ros.cdk.eci.ContainerGroup;
ContainerGroup.Builder.create(Construct scope, java.lang.String id, java.lang.Boolean enableResourcePropertyConstraint)
    .container(IResolvable)
    .container(java.util.List<IResolvable)
    .container(ContainerProperty>)
    .containerGroupName(java.lang.String)
    .containerGroupName(IResolvable)
//  .acrRegistryInfo(IResolvable)
//  .acrRegistryInfo(java.util.List<IResolvable)
//  .acrRegistryInfo(AcrRegistryInfoProperty>)
//  .activeDeadlineSeconds(java.lang.Number)
//  .activeDeadlineSeconds(IResolvable)
//  .autoMatchImageCache(java.lang.Boolean)
//  .autoMatchImageCache(IResolvable)
//  .cpu(java.lang.Number)
//  .cpu(IResolvable)
//  .dnsConfig(IResolvable)
//  .dnsConfig(DnsConfigProperty)
//  .eipInstanceId(java.lang.String)
//  .eipInstanceId(IResolvable)
//  .hostAliase(IResolvable)
//  .hostAliase(java.util.List<IResolvable)
//  .hostAliase(HostAliaseProperty>)
//  .imageRegistryCredential(IResolvable)
//  .imageRegistryCredential(java.util.List<IResolvable)
//  .imageRegistryCredential(ImageRegistryCredentialProperty>)
//  .imageSnapshotId(java.lang.String)
//  .imageSnapshotId(IResolvable)
//  .initContainer(IResolvable)
//  .initContainer(java.util.List<IResolvable)
//  .initContainer(InitContainerProperty>)
//  .instanceType(java.lang.String)
//  .instanceType(IResolvable)
//  .ipv6AddressCount(java.lang.Number)
//  .ipv6AddressCount(IResolvable)
//  .memory(java.lang.Number)
//  .memory(IResolvable)
//  .ramRoleName(java.lang.String)
//  .ramRoleName(IResolvable)
//  .resourceGroupId(java.lang.String)
//  .resourceGroupId(IResolvable)
//  .restartPolicy(java.lang.String)
//  .restartPolicy(IResolvable)
//  .securityContextSysctl(IResolvable)
//  .securityContextSysctl(java.util.List<IResolvable)
//  .securityContextSysctl(SecurityContextSysctlProperty>)
//  .securityGroupId(java.lang.String)
//  .securityGroupId(IResolvable)
//  .slsEnable(java.lang.Boolean)
//  .slsEnable(IResolvable)
//  .spotPriceLimit(java.lang.Number)
//  .spotPriceLimit(IResolvable)
//  .spotStrategy(java.lang.String)
//  .spotStrategy(IResolvable)
//  .tag(IResolvable)
//  .tag(java.util.List<IResolvable)
//  .tag(RosTag>)
//  .terminationGracePeriodSeconds(java.lang.Number)
//  .terminationGracePeriodSeconds(IResolvable)
//  .volume(IResolvable)
//  .volume(java.util.List<IResolvable)
//  .volume(VolumeProperty>)
//  .vSwitchId(java.lang.String)
//  .vSwitchId(IResolvable)
//  .zoneId(java.lang.String)
//  .zoneId(IResolvable)
    .build();
Name Type Description
scope com.aliyun.ros.cdk.core.Construct No description.
id java.lang.String No description.
enableResourcePropertyConstraint java.lang.Boolean No description.
container com.aliyun.ros.cdk.core.IResolvable OR java.util.ListContainerProperty> Property container: The containers that constitute the container group.
containerGroupName java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property containerGroupName: The name of the container group.
acrRegistryInfo com.aliyun.ros.cdk.core.IResolvable OR java.util.ListAcrRegistryInfoProperty> Property acrRegistryInfo: A list of ACR Enterprise instances.
activeDeadlineSeconds java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property activeDeadlineSeconds: The validity period in seconds.
autoMatchImageCache java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable Property autoMatchImageCache: Specifies whether to automatically match the image cache.
cpu java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property cpu: CPU size.
dnsConfig com.aliyun.ros.cdk.core.IResolvable OR DnsConfigProperty Property dnsConfig: The information about DNS configurations.
eipInstanceId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property eipInstanceId: Elastic IP ID.
hostAliase com.aliyun.ros.cdk.core.IResolvable OR java.util.ListHostAliaseProperty> Property hostAliase: Customize the hostname mapping of a container inside the pod.
imageRegistryCredential com.aliyun.ros.cdk.core.IResolvable OR java.util.ListImageRegistryCredentialProperty> Property imageRegistryCredential: The information that you need to log on to the container image repository, including the server address, username, and password.
imageSnapshotId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property imageSnapshotId: The ID of the image cache.
initContainer com.aliyun.ros.cdk.core.IResolvable OR java.util.ListInitContainerProperty> Property initContainer: The containers that constitute the container group for initializing.
instanceType java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property instanceType: The ECS instance type.
ipv6AddressCount java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property ipv6AddressCount: The number of IPv6 addresses.
memory java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property memory: memory size.
ramRoleName java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property ramRoleName: The RAM role that the container group assumes.
resourceGroupId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property resourceGroupId: Resource group id.
restartPolicy java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property restartPolicy: The policy for restarting the instance.
securityContextSysctl com.aliyun.ros.cdk.core.IResolvable OR java.util.ListSecurityContextSysctlProperty> Property securityContextSysctl: ECI Sysctl is valid for every container in ECI.
securityGroupId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property securityGroupId: The ID of the security group to which the instance belongs.
slsEnable java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable Property slsEnable: Enable user log collection.
spotPriceLimit java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property spotPriceLimit: Set the hourly maximum price of the instance.
spotStrategy java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property spotStrategy: Instance preemption strategy.
tag com.aliyun.ros.cdk.core.IResolvable OR java.util.List Property tag: The list of container group tags in the form of key\/value pairs.
terminationGracePeriodSeconds java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property terminationGracePeriodSeconds: The buffer time for the program to handle operations before it is stopped.
volume com.aliyun.ros.cdk.core.IResolvable OR java.util.ListVolumeProperty> Property volume: The data volume.
vSwitchId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property vSwitchId: The ID of the vSwitch to which the instance belongs.
zoneId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property zoneId: The ID of the zone in which the instance resides.

scopeRequired

  • Type: com.aliyun.ros.cdk.core.Construct

idRequired

  • Type: java.lang.String

enableResourcePropertyConstraintOptional

  • Type: java.lang.Boolean

containerRequired

  • Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.ListContainerProperty>

Property container: The containers that constitute the container group.


containerGroupNameRequired

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property containerGroupName: The name of the container group.

The length is [2,128] English lowercase letters, numbers or hyphens (-), cannot begin or end with a hyphens.


acrRegistryInfoOptional

  • Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.ListAcrRegistryInfoProperty>

Property acrRegistryInfo: A list of ACR Enterprise instances.


activeDeadlineSecondsOptional

  • Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable

Property activeDeadlineSeconds: The validity period in seconds.


autoMatchImageCacheOptional

  • Type: java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable

Property autoMatchImageCache: Specifies whether to automatically match the image cache.

The default value is false.


cpuOptional

  • Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable

Property cpu: CPU size.


dnsConfigOptional

Property dnsConfig: The information about DNS configurations.


eipInstanceIdOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property eipInstanceId: Elastic IP ID.


hostAliaseOptional

  • Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.ListHostAliaseProperty>

Property hostAliase: Customize the hostname mapping of a container inside the pod.


imageRegistryCredentialOptional

  • Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.ListImageRegistryCredentialProperty>

Property imageRegistryCredential: The information that you need to log on to the container image repository, including the server address, username, and password.


imageSnapshotIdOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property imageSnapshotId: The ID of the image cache.


initContainerOptional

  • Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.ListInitContainerProperty>

Property initContainer: The containers that constitute the container group for initializing.


instanceTypeOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property instanceType: The ECS instance type.

You can specify multiple instance types. For more information, see Create an instance by specifying an ECS instance type.


ipv6AddressCountOptional

  • Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable

Property ipv6AddressCount: The number of IPv6 addresses.

The value is fixed at 1, which indicates that one IPv6 address can be bound to an ECI instance.


memoryOptional

  • Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable

Property memory: memory size.


ramRoleNameOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property ramRoleName: The RAM role that the container group assumes.

ECI and ECS share the same RAM role.


resourceGroupIdOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property resourceGroupId: Resource group id.


restartPolicyOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property restartPolicy: The policy for restarting the instance.

Default value: Always.


securityContextSysctlOptional

  • Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.ListSecurityContextSysctlProperty>

Property securityContextSysctl: ECI Sysctl is valid for every container in ECI.

Currently only two Sysctl keyNames are supported: Kernel.shm_rmid_forced Kernel.msgmax


securityGroupIdOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property securityGroupId: The ID of the security group to which the instance belongs.

Instances in the same security group can access one another. If no security group is specified, the system automatically uses the default security group in the region you select. If you do not have a default security group in this region, the system automatically creates a default security group and adds the container protocol and port you declared to the inbound direction rules of this security group.


slsEnableOptional

  • Type: java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable

Property slsEnable: Enable user log collection.

The default is False.


spotPriceLimitOptional

  • Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable

Property spotPriceLimit: Set the hourly maximum price of the instance.

It supports a maximum of 3 decimal places. It takes effect when the value of the parameter SpotStrategy is SpotWithPriceLimit.


spotStrategyOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property spotStrategy: Instance preemption strategy.

Ranges: NoSpot (default): normal pay-as-you-go instances. SpotWithPriceLimit: Preemptive instance that sets a cap price. SpotAsPriceGo: The system automatically bids, following the current market actual price.


tagOptional

  • Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.List

Property tag: The list of container group tags in the form of key\/value pairs.

You can define a maximum of 20 tags for each container group.


terminationGracePeriodSecondsOptional

  • Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable

Property terminationGracePeriodSeconds: The buffer time for the program to handle operations before it is stopped.


volumeOptional

  • Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.ListVolumeProperty>

Property volume: The data volume.

You can specify a maximum of 20 data volumes.


vSwitchIdOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property vSwitchId: The ID of the vSwitch to which the instance belongs.

You can specify up to 10 vSwitch IDs. Separate multiple IDs with commas (,), for example, vsw-*,vsw-*. If you do not specify a vSwitch, the system uses the default vSwitch in the default VPC of the selected region. If you do not have a default VPC and a default vSwitch in the region, the system creates a default VPC and a default vSwitch.

The number of IP addresses in the vSwitch CIDR block determines the maximum number of ECI instances that can be created in the vSwitch. Plan the CIDR block in advance.


zoneIdOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property zoneId: The ID of the zone in which the instance resides.

If you leave the parameter blank, the system assigns a zone for you. The default value is blank.


Methods

Name Description
toString Returns a string representation of this construct.
synthesize Allows this construct to emit artifacts into the cloud assembly during synthesis.
addCondition No description.
addCount No description.
addDependency No description.
addResourceDesc No description.
applyRemovalPolicy No description.
fetchCondition No description.
fetchDependency No description.
fetchResourceDesc No description.
getAtt No description.
setMetadata No description.

toString

public java.lang.String toString()

Returns a string representation of this construct.

synthesize

public void synthesize(ISynthesisSession session)

Allows this construct to emit artifacts into the cloud assembly during synthesis.

This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.

sessionRequired

  • Type: com.aliyun.ros.cdk.core.ISynthesisSession

The synthesis session.


addCondition

public void addCondition(RosCondition condition)

conditionRequired

  • Type: com.aliyun.ros.cdk.core.RosCondition

addCount

public void addCount(java.lang.Number OR IResolvable count)

countRequired

  • Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable

addDependency

public void addDependency(Resource resource)

resourceRequired

  • Type: com.aliyun.ros.cdk.core.Resource

addResourceDesc

public void addResourceDesc(java.lang.String desc)

descRequired

  • Type: java.lang.String

applyRemovalPolicy

public void applyRemovalPolicy(RemovalPolicy policy)

policyRequired

  • Type: com.aliyun.ros.cdk.core.RemovalPolicy

fetchCondition

public RosCondition fetchCondition()

fetchDependency

public java.util.List<java.lang.String> fetchDependency()

fetchResourceDesc

public java.lang.String fetchResourceDesc()

getAtt

public IResolvable getAtt(java.lang.String name)

nameRequired

  • Type: java.lang.String

setMetadata

public void setMetadata(java.lang.String key, java.lang.Object value)

keyRequired

  • Type: java.lang.String

valueRequired

  • Type: java.lang.Object

Static Functions

Name Description
isConstruct Return whether the given object is a Construct.

isConstruct

import com.aliyun.ros.cdk.eci.ContainerGroup;
ContainerGroup.isConstruct(java.lang.Object x)

Return whether the given object is a Construct.

xRequired

  • Type: java.lang.Object

Properties

Name Type Description
node com.aliyun.ros.cdk.core.ConstructNode The construct tree node associated with this construct.
env com.aliyun.ros.cdk.core.IResourceEnvironment The environment this resource belongs to.
ref java.lang.String No description.
stack com.aliyun.ros.cdk.core.Stack The stack in which this resource is defined.
resource com.aliyun.ros.cdk.core.RosResource No description.
attrContainerGroupId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute ContainerGroupId: The ID of the container group.
attrContainerGroupName java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute ContainerGroupName: The name of the container group.
attrEniInstanceId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute EniInstanceId: ENI instance ID.
attrInternetIp java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute InternetIp: Internet IP.
attrIntranetIp java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute IntranetIp: Intranet IP.
attrIpv6Address java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute Ipv6Address: Ipv6 address.
attrRegionId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute RegionId: The ID of the region in which the instance resides.
attrSecurityGroupId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute SecurityGroupId: The ID of the security group to which the instance belongs.
attrVSwitchId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute VSwitchId: The ID of the VSwitch.
attrZoneId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute ZoneId: The ID of the zone in which the instance resides.
props ContainerGroupProps No description.

nodeRequired

public ConstructNode getNode();
  • Type: com.aliyun.ros.cdk.core.ConstructNode

The construct tree node associated with this construct.


envRequired

public IResourceEnvironment getEnv();
  • Type: com.aliyun.ros.cdk.core.IResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.


refRequired

public java.lang.String getRef();
  • Type: java.lang.String

stackRequired

public Stack getStack();
  • Type: com.aliyun.ros.cdk.core.Stack

The stack in which this resource is defined.


resourceOptional

public RosResource getResource();
  • Type: com.aliyun.ros.cdk.core.RosResource

attrContainerGroupIdRequired

public java.lang.Object getAttrContainerGroupId();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute ContainerGroupId: The ID of the container group.


attrContainerGroupNameRequired

public java.lang.Object getAttrContainerGroupName();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute ContainerGroupName: The name of the container group.


attrEniInstanceIdRequired

public java.lang.Object getAttrEniInstanceId();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute EniInstanceId: ENI instance ID.


attrInternetIpRequired

public java.lang.Object getAttrInternetIp();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute InternetIp: Internet IP.


attrIntranetIpRequired

public java.lang.Object getAttrIntranetIp();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute IntranetIp: Intranet IP.


attrIpv6AddressRequired

public java.lang.Object getAttrIpv6Address();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute Ipv6Address: Ipv6 address.


attrRegionIdRequired

public java.lang.Object getAttrRegionId();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute RegionId: The ID of the region in which the instance resides.


attrSecurityGroupIdRequired

public java.lang.Object getAttrSecurityGroupId();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute SecurityGroupId: The ID of the security group to which the instance belongs.

Instances in the same security group can access one another.


attrVSwitchIdRequired

public java.lang.Object getAttrVSwitchId();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute VSwitchId: The ID of the VSwitch.

Currently, ECI instances can only be deployed in VPCs.


attrZoneIdRequired

public java.lang.Object getAttrZoneId();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute ZoneId: The ID of the zone in which the instance resides.

If you leave the parameter blank, the system assigns a zone for you. The default value is blank.


propsRequired

public ContainerGroupProps getProps();