All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::ECI::ImageCache

更新時間:Apr 18, 2023

ALIYUN::ECI::ImageCache is used to create an image cache.

Syntax

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

Properties

Name

Type

Required

Editable

Description

Validity

EipInstanceId

String

No

No

The ID of an EIP instance.

Make sure that your ECI can access the Internet before pulling public images. We recommend that you configure a NAT gateway for your vSwitch. You can also configure a public IP address.

Image

List

Yes

No

The IDs of images to be cached.

A maximum of 20 images can be cached.

SecurityGroupId

String

Yes

No

The ID of the security group.

None

ResourceGroupId

String

No

No

The ID of the resource group.

None

VSwitchId

String

Yes

No

The ID of the vSwitch.

None

ImageRegistryCredential

List

No

No

The credentials used to log on to image repositories.

This parameter is optional for images stored in Alibaba Cloud Container Registry (ACR). A maximum of 10 credentials can be configured.

ImageCacheName

String

Yes

No

The name of the image cache.

None

ImageRegistryCredential syntax

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

ImageRegistryCredential properties

Name

Type

Required

Editable

Description

Validity

Server

String

No

No

The URL of the image repository. This URL does not include a protocol prefix, such as http:// or https://.

None

UserName

String

No

No

The username that is used to log on to the image repository.

None

Password

String

No

No

The password that is used to log on to the image repository.

None

Response parameters

Fn::GetAtt

  • ImageCacheId: the ID of the image cache.

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"
        ]
      }
    }
  }
}