ALIYUN::ECI::ImageCache

更新时间:
复制 MD 格式

Creates an image cache for 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

The ID of the elastic IP address (EIP).

The ECI instance requires internet access to pull images. Use an EIP or configure a NAT gateway for the vSwitch. A NAT gateway is recommended.

Image

List

Yes

No

The images to cache. Each item is an image ID.

Maximum: 20 images.

SecurityGroupId

String

Yes

No

The security group ID.

None.

ResourceGroupId

String

No

No

The resource group ID.

None.

VSwitchId

String

Yes

No

The vSwitch ID.

None.

ImageRegistryCredential

List

No

No

The logon credentials for the image repository.

Not required for Alibaba Cloud Container Registry (ACR) images. Maximum: 10 repositories.

ImageCacheName

String

Yes

No

The name of the image cache.

None.

ImageRegistryCredential syntax

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

ImageRegistryCredential properties

Property name

Type

Required

Update allowed

Description

Constraints

Server

String

No

No

The image repository address, excluding the http:// or https:// prefix.

None.

UserName

String

No

No

The username for the image repository.

None.

Password

String

No

No

The password for the image repository.

None.

Return values

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