ALIYUN::ESS::EciScalingConfiguration

更新时间:2025-03-26 07:06

ALIYUN::ESS::EciScalingConfiguration类型用于定义ESS和ECI的弹性伸缩配置。

语法

{
  "Type": "ALIYUN::ESS::EciScalingConfiguration",
  "Properties": {
    "ContainerGroupName": String,
    "ScalingConfigurationName": String,
    "ScalingGroupId": String,
    "SecurityGroupId": String,
    "AutoMatchImageCache": Boolean,
    "ActiveDeadlineSeconds": Integer,
    "AcrRegistryInfos": List,
    "AutoCreateEip": Boolean,
    "Containers": List,
    "Cpu": Number,
    "CpuOptionsThreadsPerCore": Integer,
    "CpuOptionsCore": Integer,
    "CostOptimization": Boolean,
    "DnsConfigSearches": List,
    "DataCachePL": String,
    "DataCacheProvisionedIops": Integer,
    "DataCacheBucket": String,
    "DnsConfigOptions": List,
    "DnsConfigNameServers": List,
    "DataCacheBurstingEnabled": Boolean,
    "DnsPolicy": String,
    "EgressBandwidth": Integer,
    "EipBandwidth": Integer,
    "EphemeralStorage": Integer,
    "HostName": String,
    "HostAliases": List,
    "IngressBandwidth": Integer,
    "ImageSnapshotId": String,
    "Ipv6AddressCount": Integer,
    "InstanceTypes": List,
    "InitContainers": List,
    "ImageRegistryCredentials": List,
    "InstanceFamilyLevel": String,
    "LoadBalancerWeight": Integer,
    "Memory": Number,
    "NtpServers": List,
    "ResourceGroupId": String,
    "RamRoleName": String,
    "RestartPolicy": String,
    "SpotPriceLimit": Number,
    "SpotStrategy": String,
    "SecurityContextSysctls": List,
    "Tags": List,
    "TerminationGracePeriodSeconds": Integer,
    "Volumes": List
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

属性名称

类型

必须

允许更新

描述

约束

ContainerGroupName

String

ECI实例名称。

即容器组名称。

如果要设置有序名称,格式为name_prefix(AUTO_INCREMENT)[begin_number,bits]name_suffix

  • name_prefix:指定主机名称的前缀。

  • (AUTO_INCREMENT):固定值,用来标识此排序方式。

  • begin_number:有序数值的起始值,取值范围:[0,999999]

  • bits:有序数值所占的位数,取值范围:[1,6],当指定的begin_number位数大于bits的取值时,bits默认为6。

说明

bits建议最少为3,否则容易达到有序数值的上限。在达到上限后,若还有扩容需求,伸缩活动会报错,并停止扩容。此时,您需要重新设置生成主机名称的规则。

  • name_suffix(可选):指定主机名称的后缀。

说明

[begin_number,bits]中不能有空格,且系统默认依次递增,但是如果存在扩容的ECI实例无法启动,会被伸缩组移除后再扩容一台新的ECI实例,所以伸缩组内ECI实例的主机名称可能断续递增。

示例:当设置为nginx-test-(AUTO_INCREMENT)[0,3]时,容器组名称为nginx-test-000、nginx-test-001、nginx-test-002。

设置ECI有序实例名称的规则与设置ECS伸缩组有序实例规格相同,具体规则介绍,请参见设置有序且唯一的实例名称或主机名称规则

ScalingConfigurationName

String

伸缩配置的名称。

长度为2~64个英文或中文字符组成,以数字、大小写字母或中文开头,可包含数字、下划线(_)、短划线(-)或半角句号(.)。

在同一地域下同一伸缩组内伸缩配置名称唯一。如果您没有指定该参数,则默认使用伸缩配置的ID。

ScalingGroupId

String

伸缩配置所属的伸缩组的ID。

SecurityGroupId

String

ECI实例所属的安全组ID。

同一个安全组内的ECI实例之间可以互相访问。

如果没有指定安全组,系统将自动使用您选择的地域下的默认安全组,您需要确保该安全组的入方向规则中包含容器需要暴露的协议和端口。如果您在该地域下没有默认安全组,系统将自动创建一个默认安全组,并将您声明的容器协议和端口添加到该安全组的入方向规则中。

AutoMatchImageCache

Boolean

是否自动匹配镜像缓存。

取值范围:

  • true:是。

  • false:否。

默认值:false。

ActiveDeadlineSeconds

Integer

有效期限。

单位为秒。

AcrRegistryInfos

List

ACR 企业版实例的信息。

更多信息,请参见AcrRegistryInfos属性。

AutoCreateEip

Boolean

是否自动创建弹性公网 IP。

Containers

List

实例包含的容器列表。

更多信息,请参见Containers属性

Cpu

Number

容器 CPU 核数。

CpuOptionsThreadsPerCore

Integer

每核线程数。

仅部分规格支持自定义设置。配置为 1 时表示关闭超线程。更多信息,请参见自定义CPU选项

CpuOptionsCore

Integer

cpu 物理核心数。

仅部分实例规格支持自定义设置。更多信息,请参见自定义CPU选项

CostOptimization

Boolean

是否开启成本优化开关。

可能值:

  • true:开启。

  • false:未开启。

DnsConfigSearches

List

DNS搜索域列表。

DataCachePL

String

数据缓存使用的云盘的性能等级。

建议优先使用ESSD云盘,该云盘的性能等级的可能值:

  • PL0:单盘最高随机读写IOPS 1万。

  • PL1:单盘最高随机读写IOPS 5万。

  • PL2:单盘最高随机读写IOPS 10万。

  • PL3:单盘最高随机读写IOPS 100万。

DataCacheProvisionedIops

Integer

ESSD AutoPL云盘预配置的读写IOPS。

数据缓存使用ESSD AutoPL云盘时生效,可能值:0~min{50000, 1000*容量-基准性能},其中,基准性能=min{1800+50*容量, 50000}。

DataCacheBucket

String

数据缓存Bucket。

DnsConfigOptions

List

对象选项列表,

更多信息,请参见DnsConfigOptions属性。

DnsConfigNameServers

List

DNS服务器的IP地址列表。

DataCacheBurstingEnabled

Boolean

是否开启Burst(性能突发)。

数据缓存使用ESSD AutoPL云盘时生效,可选值:

  • true:开启。

  • false:未开启。

DnsPolicy

String

DNS策略。

取值范围:

  • None:使用DnsConfig字段设置的DNS。

  • Default:继承运行环境的DNS设置。

EgressBandwidth

Integer

出方向带宽限制。

单位:Byte。

EipBandwidth

Integer

弹性公网IP的带宽。

默认为5 M。

EphemeralStorage

Integer

临时存储空间大小。

默认使用ESSD PL1类型的云盘。单位:GiB。

HostName

String

主机名称。

HostAliases

List

自定义实例内一个容器的Hostname映射。

IngressBandwidth

Integer

入方向带宽限制。

单位:Byte。

ImageSnapshotId

String

镜像缓存ID。

Ipv6AddressCount

Integer

IPv6地址数。

InstanceTypes

List

指定的ECS实例规格。

支持多个规格(最多支持5个),更多信息,请参见指定ECS规格创建实例

InitContainers

List

Init容器列表。

更多信息,请参见InitContainers属性。

ImageRegistryCredentials

List

镜像仓库信息。

InstanceFamilyLevel

String

实例规格族级别。

用于筛选符合要求的实例规格范围,当CostOptimization开启时生效。可能值:

  • EntryLevel:入门级,即共享型实例规格。成本更低,但是无法保证实例计算性能的稳定。适用于平时CPU使用率低的业务场景。更多信息,请参见共享型

  • EnterpriseLevel:企业级。性能稳定且资源独享,适用于对稳定性要求高的业务场景。更多信息,请参见实例规格族

  • CreditEntryLevel:积分入门级,即突发性能实例。通过CPU积分来保证计算性能,适用于平时CPU使用率低、偶尔突发CPU使用率的业务场景。更多信息,请参见突发性能实例概述

LoadBalancerWeight

Integer

ECI实例作为后端服务器时的权重,

可能值:1~100。

Memory

Number

容器内存大小。

NtpServers

List

NTP服务器。

ResourceGroupId

String

资源组ID。

RamRoleName

String

实例RAM角色名称。

ECI与ECS共用实例RAM角色。

RestartPolicy

String

容器组的重启策略。

可能值:

  • Never:不重启。

  • Always:始终重启。

  • OnFailure:失败时重启。

SpotPriceLimit

Number

抢占式实例的每小时最高价格。

仅当SpotStrategy为SpotWithPriceLimit时返回。

SpotStrategy

String

实例的抢占策略。

可能值:

  • NoSpot:正常按量付费实例。

  • SpotWithPriceLimit:设置上限价格的抢占式实例。

  • SpotAsPriceGo:系统自动出价,跟随当前市场实际价格。

SecurityContextSysctls

List

实例运行的安全上下文的系统信息。

Tags

List

实例的标签键值对。

更多信息,请参见Tags属性

TerminationGracePeriodSeconds

Integer

程序的缓冲时间。

用于处理关闭之前的操作。

Volumes

List

数据卷信息。

更多信息,请参见Volumes属性

Containers语法

"Containers": [
  {
    "EnvironmentVars": List,
    "ReadinessProbeExecCommands": List,
    "Memory": Number,
    "ReadinessProbeTcpSocketPort": Integer,
    "Cpu": Number,
    "ReadinessProbeHttpGetPath": String,
    "ReadinessProbeHttpGetScheme": String,
    "Image": String,
    "Gpu": Integer,
    "StdinOnce": Boolean,
    "Name": String,
    "LivenessProbeHttpGetScheme": String,
    "LivenessProbeTimeoutSeconds": Integer,
    "LivenessProbeFailureThreshold": Integer,
    "LivenessProbeHttpGetPath": String,
    "VolumeMounts": List,
    "LivenessProbeInitialDelaySeconds": Integer,
    "SecurityContextRunAsUser": Integer,
    "LivenessProbeTcpSocketPort": Integer,
    "Commands": List,
    "Tty": Boolean,
    "ReadinessProbePeriodSeconds": Integer,
    "LivenessProbePeriodSeconds": Integer,
    "LivenessProbeExecCommands": List,
    "LivenessProbeSuccessThreshold": Integer,
    "ReadinessProbeSuccessThreshold": Integer,
    "ReadinessProbeInitialDelaySeconds": Integer,
    "Args": List,
    "ReadinessProbeFailureThreshold": Integer,
    "SecurityContextCapabilitiesAdd": List,
    "Ports": List,
    "ReadinessProbeHttpGetPort": Integer,
    "Stdin": Boolean,
    "WorkingDir": String,
    "ImagePullPolicy": String,
    "LivenessProbeHttpGetPort": Integer,
    "ReadinessProbeTimeoutSeconds": Integer
  }
]

Containers属性

属性名称

类型

必须

允许更新

描述

约束

属性名称

类型

必须

允许更新

描述

约束

EnvironmentVars

List

环境变量的信息列表。

更多信息,请参见EnvironmentVars属性

ReadinessProbeExecCommands

List

使用命令行方式进行健康检查时,在容器内执行的命令。

无。

Memory

Number

内存大小。

ReadinessProbeTcpSocketPort

Integer

TCP Socket的端口号。

Cpu

Number

容器的vCPU大小。

ReadinessProbeHttpGetPath

String

HttpGet检测的路径。

ReadinessProbeHttpGetScheme

String

HTTP Get请求对应的协议类型。

可选值:

  • HTTP。

  • HTTPS。

Image

String

容器镜像。

Gpu

Integer

指定容器使用的GPU个数。

StdinOnce

Boolean

会话是否保持开启状态。

当标准输入为true时,标准输入流将在多个附加会话中保持开启状态。

如果StdinOnce设为true,标准输入在容器开启时被打开,在首个客户端附加到标准输入之前都为空,然后会一直保持开启状态,接收数据,直到客户端连接断开,此时标准输入被关闭,在容器重启前一直保持关闭状态。

Name

String

自定义的容器名称。

LivenessProbeHttpGetScheme

String

HTTP Get请求对应的协议类型。

可选值:

  • HTTP。

  • HTTPS。

LivenessProbeTimeoutSeconds

Integer

检查超时的时间。

默认为1秒,最小值为1秒。

LivenessProbeFailureThreshold

Integer

从上次检查成功后认定检查失败的检查次数阈值。

默认值:3。

LivenessProbeHttpGetPath

String

HttpGet检测的路径。

VolumeMounts

List

挂载数据卷列表。

更多信息,请参见VolumeMounts属性

LivenessProbeInitialDelaySeconds

Integer

检查开始执行的时间。

以容器启动完成为起点计算。

SecurityContextRunAsUser

Integer

设置运行容器的用户ID。

LivenessProbeTcpSocketPort

Integer

TCP Socket的端口号。

Commands

List

容器启动命令。

最多20个。每个命令最多包含256个字符。更多信息,请参见。

Tty

Boolean

是否开启交互。

可能值:

  • true:开启。

  • false:未开启。

ReadinessProbePeriodSeconds

Integer

检查执行的周期。

默认为10秒,最小为1秒。

LivenessProbePeriodSeconds

Integer

检查执行的周期。

默认为10秒,最小值为1秒。

LivenessProbeExecCommands

List

使用命令行方式进行健康检查时。

在容器内执行的命令。

LivenessProbeSuccessThreshold

Integer

从上次检查失败后重新认定检查成功的检查次数阈值。

默认为1。当前值必须为1。

ReadinessProbeSuccessThreshold

Integer

从上次检查失败后重新认定检查成功的检查次数阈值

默认为1。当前值必须为1

ReadinessProbeInitialDelaySeconds

Integer

扩容或缩容的冷却时间。

取值范围[0, 3600],单位为秒。默认为 0 秒。

Args

List

容器启动命令对应的参数。

最多10个。

ReadinessProbeFailureThreshold

Integer

从上次检查成功后认定检查失败的检查次数阈值。

默认值:3。

SecurityContextCapabilitiesAdd

List

授予初始化容器中进程的权限。

取值:

  • NET_ADMIN

  • NET_RAW

Ports

List

暴露端口和协议列表。

更多信息,请参见Ports属性

ReadinessProbeHttpGetPort

Integer

HttpGet检测的端口。

Stdin

Boolean

此容器是否应在容器运行时为标准输入分配缓冲区。

如果未设置,则容器中标准输入的读取值将导致EOF。

默认值:false。

WorkingDir

String

工作目录。

ImagePullPolicy

String

镜像拉取策略。

LivenessProbeHttpGetPort

Integer

HttpGet检测的端口。

ReadinessProbeTimeoutSeconds

Integer

检查超时的时间。

默认为1秒,最小为1秒。

EnvironmentVars语法

"EnvironmentVars": [
  {
    "Value": String,
    "Key": String
  }
]

EnvironmentVars属性

属性名称

类型

必须

允许更新

描述

约束

属性名称

类型

必须

允许更新

描述

约束

Value

String

环境变量值。

Key

String

环境变量名。

AcrRegistryInfos语法

"AcrRegistryInfos": [
  {
    "RegionId": String,
    "InstanceId": String,
    "Domains": List,
    "InstanceName": String
  }
]

AcrRegistryInfos否属性

属性名称

类型

必须

允许更新

描述

约束

属性名称

类型

必须

允许更新

描述

约束

RegionId

String

ACR企业版实例所属地域。

InstanceId

String

ACR企业版实例ID。

Domains

List

ACR企业版实例的域名列表。

InstanceName

String

ACR企业版实例的名称。

InitContainers语法

"InitContainers": [
  {
    "SecurityContextRunAsUser": Integer,
    "Memory": Number,
    "Args": List,
    "ImagePullPolicy": String,
    "Commands": List,
    "Gpu": Integer,
    "WorkingDir": String,
    "InitContainerEnvironmentVars": List,
    "SecurityContextCapabilitiesAdd": List,
    "Cpu": Number,
    "InitContainerVolumeMounts": List,
    "Image": String,
    "Name": String
  }
]

InitContainers否属性

属性名称

类型

必须

允许更新

描述

约束

属性名称

类型

必须

允许更新

描述

约束

SecurityContextRunAsUser

Integer

设置运行容器的用户ID。

Memory

Integer

内存大小。

Args

List

容器启动命令对应的参数。

最多配置10个。

ImagePullPolicy

String

镜像拉取策略。

Commands

List

容器启动命令。

最多20个。每个命令最多包含256个字符。

Gpu

Integer

指定容器使用的GPU个数。

WorkingDir

String

工作目录。

InitContainerEnvironmentVars

List

环境变量的信息。

SecurityContextCapabilitiesAdd

List

为容器内的进程授予某些特定的权限。

目前仅支持配置为NET_ADMIN和NET_RAW。

Cpu

Integer

CPU大小。

InitContainerVolumeMounts

List

数据卷挂载。

Image

String

容器使用的镜像。

Name

String

容器名称。

VolumeMounts语法

"VolumeMounts": [
  {
    "ReadOnly": Boolean,
    "MountPath": String,
    "SubPath": String,
    "MountPropagation": String,
    "Name": String
  }
]

VolumeMounts属性

属性名称

类型

必须

允许更新

描述

约束

属性名称

类型

必须

允许更新

描述

约束

ReadOnly

Boolean

挂载路径是否只读。

MountPath

String

挂载目录。

容器的挂载目录下的内容被volume的内容直接覆盖,所以要慎用。

SubPath

String

数据卷下的子目录。

方便Pod将同一个Volume下不同目录挂载到容器不同目录。

MountPropagation

String

数据卷的挂载传播设置。

挂载传播允许将Container挂载的卷共享到同一Pod中的其他Container,甚至可以共享到同一节点上的其他Pod。可能值:

  • None:该卷不感知任何后续在此卷或其子目录上执行的挂载操作。

  • HostToCotainer:该卷将会感知到后续在此卷或其子目录上的挂载操作。

  • Bidirectional:和HostToCotainer类似,能感知挂载操作。另外,该卷将被传播回主机和使用同一卷的所有Pod的所有容器。

Name

String

挂载数据卷的名称。

HostAliases语法

"HostAliases": [
  {
    "Ip": String,
    "Hostnames": List
  }
]

HostAliases属性

属性名称

类型

必须

允许更新

描述

约束

属性名称

类型

必须

允许更新

描述

约束

Ip

String

IP地址。

Hostnames

List

主机名列表。

DnsConfigOptions语法

"DnsConfigOptions": [
  {
    "Value": String,
    "Name": String
  }
]

DnsConfigOptions属性

属性名称

类型

必须

允许更新

描述

约束

属性名称

类型

必须

允许更新

描述

约束

Value

String

对象变量值。

Name

String

对象的变量名。

SecurityContextSysctls语法

"SecurityContextSysctls": [
  {
    "Value": String,
    "Name": String
  }
]

SecurityContextSysctls属性

属性名称

类型

必须

允许更新

描述

约束

属性名称

类型

必须

允许更新

描述

约束

Name

String

实例运行的安全上下文系统名称。

Value

String

实例运行的安全上下文的变量值。

ImageRegistryCredentials语法

"ImageRegistryCredentials": [
  {
    "UserName": String,
    "Server": String,
    "Password": String
  }
]

ImageRegistryCredentials属性

属性名称

类型

必须

允许更新

描述

约束

属性名称

类型

必须

允许更新

描述

约束

UserName

String

镜像仓库用户名。

Server

String

镜像仓库注册地址。

Password

String

镜像仓库密码。

Tags语法

"Tags": [
  {
    "Value": String,
    "Key": String
  }
]

Tags属性

属性名称

类型

必须

允许更新

描述

约束

属性名称

类型

必须

允许更新

描述

约束

Key

String

标签键。

Value

String

标签值。

Volumes语法

"Volumes": [
  {
    "HostPathVolumeType": String,
    "EmptyDirVolumeSizeLimit": String,
    "FlexVolumeFsType": String,
    "NFSVolumeServer": String,
    "DiskVolumeDiskSize": Integer,
    "ConfigFileVolumeConfigFileToPaths": List,
    "Name": String,
    "NFSVolumeReadOnly": Boolean,
    "HostPathVolumePath": String,
    "NFSVolumePath": String,
    "Type": String,
    "FlexVolumeDriver": String,
    "DiskVolumeDiskId": String,
    "ConfigFileVolumeDefaultMode": Integer,
    "FlexVolumeOptions": String,
    "EmptyDirVolumeMedium": String
  }
]

Volumes属性

属性名称

类型

必须

允许更新

描述

约束

属性名称

类型

必须

允许更新

描述

约束

HostPathVolumeType

String

HostPath Volume的类型。

EmptyDirVolumeSizeLimit

String

EmptyDir数据卷的大小。

FlexVolumeFsType

String

挂载的文件系统类型。

NFSVolumeServer

String

NFS服务器地址。

DiskVolumeDiskSize

Integer

DiskVolume的大小。

单位为GiB。

ConfigFileVolumeConfigFileToPaths

List

配置文件路径列表。

更多信息,请参见ConfigFileVolumeConfigFileToPaths属性

Name

String

数据卷名称。

NFSVolumeReadOnly

Boolean

NFS数据卷是否只读。

HostPathVolumePath

String

HostPath Volume在主机上的目录路径。

NFSVolumePath

String

NFS数据卷路径。

Type

String

数据卷类型。

可能值:

  • EmptyDirVolume。

  • NFSVolume。

  • ConfigFileVolume。

  • FlexVolume。

FlexVolumeDriver

String

用于FlexVolume的驱动程序名称。

DiskVolumeDiskId

String

数据卷磁盘ID。

ConfigFileVolumeDefaultMode

Integer

ConfigFileVolume默认的权限。

FlexVolumeOptions

String

FlexVolume对象选项列表。

为KV形式,采用JSON传递。

例如:通过FlexVolume挂载云盘时,Options的格式为{"volumeId":"d-2zehdahrwoa7srg****","performanceLevel": "PL2"}

EmptyDirVolumeMedium

String

EmptyDirVolume的存储媒介。

默认为空,使用node文件系统。支持memory,表示使用内存。

ConfigFileVolumeConfigFileToPaths语法

"ConfigFileVolumeConfigFileToPaths": [
  {
    "Path": String,
    "Content": String,
    "Mode": Integer
  }
]

ConfigFileVolumeConfigFileToPaths属性

属性名称

类型

必须

允许更新

描述

约束

属性名称

类型

必须

允许更新

描述

约束

Path

String

相对文件路径。

Content

String

配置文件内容

Mode

Integer

ConfigFileVolume目录权限。

Ports语法

"Ports": [
  {
    "Port": Integer,
    "Protocol": String
  }
]

Ports属性

属性名称

类型

必须

允许更新

描述

约束

属性名称

类型

必须

允许更新

描述

约束

Port

Integer

端口号。

可能值:1~65535。

Protocol

String

协议类型。

可能值:

  • TCP。

  • UDP。

返回值

Fn::GetAtt

ScalingConfigurationId:伸缩配置的ID。

示例

YAML
JSON
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  SecurityGroupId:
    AssociationProperty: ALIYUN::ECS::SecurityGroup::SecurityGroupId
    Required: true
    Type: String
    Description:
      en: |-
        The ID of the security group with which you want to associate the elastic container instance. Elastic container instances that are associated with the same security group can access each other.
        If you do not specify a security group, the system uses the default security group in the region that you selected. Make sure that the inbound rules of the security group contain the protocols and the port numbers of the containers that you want to expose. If you do not have a default security group in the region, the system creates a default security group and adds the declared container protocols and port numbers to the inbound rules of the security group.
  ContainerGroupName:
    Required: true
    Type: String
    Description:
      en: The name of the elastic container instance.
  ScalingConfigurationName:
    Required: true
    Type: String
    Description:
      en: |-
        The name of the scaling configuration. The name must be 2 to 64 characters in length and can contain letters, digits, underscores (_), hyphens (-), and periods (.). The name must start with a letter or a digit.
        The name of the scaling configuration must be unique in a region. If you do not specify this parameter, the scaling configuration ID is used.
  ScalingGroupId:
    AssociationProperty: ALIYUN::ESS::AutoScalingGroup::AutoScalingGroupId
    Required: true
    Type: String
    Description:
      en: The ID of the scaling group for which you want to create the scaling configuration.
Resources:
  EciScalingConfiguration:
    Type: ALIYUN::ESS::EciScalingConfiguration
    Properties:
      Containers:
        - LivenessProbeHttpGetPath: ''
          Name: container-1
          Image: registry-vpc.cn-shenzhen.aliyuncs.com/eci_open/nginx:1.14.2-alpine
          Memory: 0
          WorkingDir: ''
          LivenessProbeHttpGetScheme: HTTP
          ReadinessProbeHttpGetScheme: HTTP
          ReadinessProbeHttpGetPath: ''
          ImagePullPolicy: IfNotPresent
          Gpu: 0
          Cpu: 0
      SecurityGroupId:
        Ref: SecurityGroupId
      ScalingGroupId:
        Ref: ScalingGroupId
      ScalingConfigurationName:
        Ref: ScalingConfigurationName
      ContainerGroupName:
        Ref: ContainerGroupName
Outputs:
  ScalingConfigurationId:
    Description: The ID of the elastic container instance.
    Value:
      Fn::GetAtt:
        - EciScalingConfiguration
        - ScalingConfigurationId
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "SecurityGroupId": {
      "AssociationProperty": "ALIYUN::ECS::SecurityGroup::SecurityGroupId",
      "Required": true,
      "Type": "String",
      "Description": {
        "en": "The ID of the security group with which you want to associate the elastic container instance. Elastic container instances that are associated with the same security group can access each other.\nIf you do not specify a security group, the system uses the default security group in the region that you selected. Make sure that the inbound rules of the security group contain the protocols and the port numbers of the containers that you want to expose. If you do not have a default security group in the region, the system creates a default security group and adds the declared container protocols and port numbers to the inbound rules of the security group."
      }
    },
    "ContainerGroupName": {
      "Required": true,
      "Type": "String",
      "Description": {
        "en": "The name of the elastic container instance."
      }
    },
    "ScalingConfigurationName": {
      "Required": true,
      "Type": "String",
      "Description": {
        "en": "The name of the scaling configuration. The name must be 2 to 64 characters in length and can contain letters, digits, underscores (_), hyphens (-), and periods (.). The name must start with a letter or a digit.\nThe name of the scaling configuration must be unique in a region. If you do not specify this parameter, the scaling configuration ID is used."
      }
    },
    "ScalingGroupId": {
      "AssociationProperty": "ALIYUN::ESS::AutoScalingGroup::AutoScalingGroupId",
      "Required": true,
      "Type": "String",
      "Description": {
        "en": "The ID of the scaling group for which you want to create the scaling configuration."
      }
    }
  },
  "Resources": {
    "EciScalingConfiguration": {
      "Type": "ALIYUN::ESS::EciScalingConfiguration",
      "Properties": {
        "Containers": [
          {
            "LivenessProbeHttpGetPath": "",
            "Name": "container-1",
            "Image": "registry-vpc.cn-shenzhen.aliyuncs.com/eci_open/nginx:1.14.2-alpine",
            "Memory": 0,
            "WorkingDir": "",
            "LivenessProbeHttpGetScheme": "HTTP",
            "ReadinessProbeHttpGetScheme": "HTTP",
            "ReadinessProbeHttpGetPath": "",
            "ImagePullPolicy": "IfNotPresent",
            "Gpu": 0,
            "Cpu": 0
          }
        ],
        "SecurityGroupId": {
          "Ref": "SecurityGroupId"
        },
        "ScalingGroupId": {
          "Ref": "ScalingGroupId"
        },
        "ScalingConfigurationName": {
          "Ref": "ScalingConfigurationName"
        },
        "ContainerGroupName": {
          "Ref": "ContainerGroupName"
        }
      }
    }
  },
  "Outputs": {
    "ScalingConfigurationId": {
      "Description": "The ID of the elastic container instance.",
      "Value": {
        "Fn::GetAtt": [
          "EciScalingConfiguration",
          "ScalingConfigurationId"
        ]
      }
    }
  }
}
  • 本页导读 (1)
  • 语法
  • 属性
  • Containers语法
  • Containers属性
  • EnvironmentVars语法
  • EnvironmentVars属性
  • AcrRegistryInfos语法
  • AcrRegistryInfos否属性
  • InitContainers语法
  • InitContainers否属性
  • VolumeMounts语法
  • VolumeMounts属性
  • HostAliases语法
  • HostAliases属性
  • DnsConfigOptions语法
  • DnsConfigOptions属性
  • SecurityContextSysctls语法
  • SecurityContextSysctls属性
  • ImageRegistryCredentials语法
  • ImageRegistryCredentials属性
  • Tags语法
  • Tags属性
  • Volumes语法
  • Volumes属性
  • ConfigFileVolumeConfigFileToPaths语法
  • ConfigFileVolumeConfigFileToPaths属性
  • Ports语法
  • Ports属性
  • 返回值
  • 示例
文档反馈
phone 联系我们