All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::ECI::ImageCache

Last Updated:Jun 11, 2026

Membuat cache gambar untuk Elastic Container Instance (ECI).

Syntax

{
  "Type": "ALIYUN::ECI::ImageCache",
  "Properties": {
    "EipInstanceId": String,
    "Image": List,
    "SecurityGroupId": String,
    "ResourceGroupId": String,
    "VSwitchId": String,
    "ImageRegistryCredential": List,
    "ImageCacheName": String
  }
}

Properties

Property Name

Type

Required

Update allowed

Description

Constraints

EipInstanceId

String

No

No

ID dari alamat IP elastis (EIP).

Instans ECI memerlukan akses Internet untuk menarik gambar. Gunakan EIP atau konfigurasikan NAT gateway untuk vSwitch tersebut. Disarankan menggunakan NAT gateway.

Image

List

Yes

No

Gambar yang akan di-cache. Setiap item merupakan ID gambar.

Maksimum: 20 gambar.

SecurityGroupId

String

Yes

No

ID security group.

None.

ResourceGroupId

String

No

No

ID kelompok sumber daya.

None.

VSwitchId

String

Yes

No

ID vSwitch.

None.

ImageRegistryCredential

List

No

No

Kredensial logon untuk repository image.

Tidak diperlukan untuk gambar Alibaba Cloud Container Registry (ACR). Maksimum: 10 repository.

ImageCacheName

String

Yes

No

Nama cache gambar.

None.

ImageRegistryCredential syntax

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

ImageRegistryCredential properties

Property name

Type

Required

Update allowed

Description

Constraints

Server

String

No

No

Alamat repository image, tidak termasuk awalan http:// atau https://.

None.

UserName

String

No

No

Username untuk repository image.

None.

Password

String

No

No

Password untuk repository image.

None.

Return values

Fn::GetAtt

  • ImageCacheId: ID dari cache gambar.

Examples

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Description: Test ECI ImageCache
Parameters:
  ZoneId:
    Type: String
    AssociationProperty: ALIYUN::ECS::Instance:ZoneId
  VpcId:
    Type: String
    AssociationProperty: ALIYUN::ECS::VPC::VPCId
  VSwitchId:
    Type: String
    AssociationProperty: ALIYUN::ECS::VSwitch::VSwitchId
    AssociationPropertyMetadata:
      VpcId: VpcId
      ZoneId: ZoneId
  SecurityGroupId:
    Type: String
    AssociationProperty: ALIYUN::ECS::SecurityGroup::SecurityGroupId
    AssociationPropertyMetadata:
      VpcId: VpcId
  Image:
    Type: Json
    Description: The image list to be cached.
    MaxLength: 20
    Default: '["busybox"]'
  ImageCacheName:
    Type: String
    Description: Image cache name.
    Default: mytest
Resources:
  Eip:
    Type: ALIYUN::VPC::EIP
    Properties:
      InternetChargeType: PayByTraffic
      Bandwidth: 5
  ImageCache:
    Type: ALIYUN::ECI::ImageCache
    Properties:
      EipInstanceId:
        Ref: Eip
      Image:
        Ref: Image
      SecurityGroupId:
        Ref: SecurityGroupId
      VSwitchId:
        Ref: VSwitchId
      ImageCacheName:
        Ref: ImageCacheName
Outputs:
  ImageCacheId:
    Description: The ID of the image cache.
    Value:
      Fn::GetAtt:
        - ImageCache
        - ImageCacheId

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Description": "Test ECI ImageCache",
  "Parameters": {
    "ZoneId": {
      "Type": "String",
      "AssociationProperty": "ALIYUN::ECS::Instance:ZoneId"
    },
    "VpcId": {
      "Type": "String",
      "AssociationProperty": "ALIYUN::ECS::VPC::VPCId"
    },
    "VSwitchId": {
      "Type": "String",
      "AssociationProperty": "ALIYUN::ECS::VSwitch::VSwitchId",
      "AssociationPropertyMetadata": {
        "VpcId": "VpcId",
        "ZoneId": "ZoneId"
      }
    },
    "SecurityGroupId": {
      "Type": "String",
      "AssociationProperty": "ALIYUN::ECS::SecurityGroup::SecurityGroupId",
      "AssociationPropertyMetadata": {
        "VpcId": "VpcId"
      }
    },
    "Image": {
      "Type": "Json",
      "Description": "The image list to be cached.",
      "MaxLength": 20,
      "Default": "[\"busybox\"]"
    },
    "ImageCacheName": {
      "Type": "String",
      "Description": "Image cache name.",
      "Default": "mytest"
    }
  },
  "Resources": {
    "Eip": {
      "Type": "ALIYUN::VPC::EIP",
      "Properties": {
        "InternetChargeType": "PayByTraffic",
        "Bandwidth": 5
      }
    },
    "ImageCache": {
      "Type": "ALIYUN::ECI::ImageCache",
      "Properties": {
        "EipInstanceId": {
          "Ref": "Eip"
        },
        "Image": {
          "Ref": "Image"
        },
        "SecurityGroupId": {
          "Ref": "SecurityGroupId"
        },
        "VSwitchId": {
          "Ref": "VSwitchId"
        },
        "ImageCacheName": {
          "Ref": "ImageCacheName"
        }
      }
    }
  },
  "Outputs": {
    "ImageCacheId": {
      "Description": "The ID of the image cache.",
      "Value": {
        "Fn::GetAtt": [
          "ImageCache",
          "ImageCacheId"
        ]
      }
    }
  }
}