ALIYUN::ECI::ImageCache类型用于创建镜像缓存。

语法

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

属性

属性名称 类型 必须 允许更新 描述 约束
EipInstanceId String 弹性公网IP实例ID。 拉取公网镜像需要确保ECI能够访问到公网。因此,您需要配公网IP,也可以配置交换机NAT网关,推荐使用后者。
Image List 要缓存的镜像,列表内为镜像ID。 最多缓存20个镜像。
SecurityGroupId String 安全组ID。 无。
ResourceGroupId String 资源组ID。 无。
VSwitchId String 交换机ID。 无。
ImageRegistryCredential List 镜像仓库登录信息。 阿里云ACR的镜像信息可以不填。最多设置10组登录信息。
ImageCacheName String 镜像缓存名。 无。

ImageRegistryCredential语法

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

ImageRegistryCredential属性

属性名称 类型 必须 允许更新 描述 约束
Server String 不带http://或https://前缀的镜像仓库地址。 无。
UserName String 镜像仓库用户名。 无。
Password String 镜像仓库密码。 无。

返回值

Fn::GetAtt

  • ImageCacheId:镜像缓存ID。

示例

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Resources": {
    "ImageCache": {
      "Type": "ALIYUN::ECI::ImageCache",
      "Properties": {
        "EipInstanceId": {
          "Ref": "EipInstanceId"
        },
        "Image": {
          "Ref": "Image"
        },
        "SecurityGroupId": {
          "Ref": "SecurityGroupId"
        },
        "ResourceGroupId": {
          "Ref": "ResourceGroupId"
        },
        "VSwitchId": {
          "Ref": "VSwitchId"
        },
        "ImageRegistryCredential": {
          "Ref": "ImageRegistryCredential"
        },
        "ImageCacheName": {
          "Ref": "ImageCacheName"
        }
      }
    }
  },
  "Parameters": {
    "EipInstanceId": {
      "Type": "String",
      "Description": "If you want to pull the public network image, you need to configure the public network ip or configure the switch NAT gateway."
    },
    "Image": {
      "Type": "Json",
      "Description": "The image list to be cached.",
      "MaxLength": 20
    },
    "SecurityGroupId": {
      "Type": "String",
      "Description": "Security group ID."
    },
    "ResourceGroupId": {
      "Type": "String",
      "Description": "Resource group."
    },
    "VSwitchId": {
      "Type": "String",
      "Description": "VSwitch ID."
    },
    "ImageRegistryCredential": {
      "Type": "Json",
      "Description": "Private image password. Alibaba Cloud ACR image can be left blank.",
      "MaxLength": 10
    },
    "ImageCacheName": {
      "Type": "String",
      "Description": "Image cache name."
    }
  },
  "Outputs": {
    "ImageCacheId": {
      "Description": "The ID of the image cache.",
      "Value": {
        "Fn::GetAtt": [
          "ImageCache",
          "ImageCacheId"
        ]
      }
    }
  }
}

YAML格式

ROSTemplateFormatVersion: '2015-09-01'
Resources:
  ImageCache:
    Type: ALIYUN::ECI::ImageCache
    Properties:
      EipInstanceId:
        Ref: EipInstanceId
      Image:
        Ref: Image
      SecurityGroupId:
        Ref: SecurityGroupId
      ResourceGroupId:
        Ref: ResourceGroupId
      VSwitchId:
        Ref: VSwitchId
      ImageRegistryCredential:
        Ref: ImageRegistryCredential
      ImageCacheName:
        Ref: ImageCacheName
Parameters:
  EipInstanceId:
    Type: String
    Description: If you want to pull the public network image, you need to configure
      the public network ip or configure the switch NAT gateway.
  Image:
    Type: Json
    Description: The image list to be cached.
    MaxLength: 20
  SecurityGroupId:
    Type: String
    Description: Security group ID.
  ResourceGroupId:
    Type: String
    Description: Resource group.
  VSwitchId:
    Type: String
    Description: VSwitch ID.
  ImageRegistryCredential:
    Type: Json
    Description: Private image password. Alibaba Cloud ACR image can be left blank.
    MaxLength: 10
  ImageCacheName:
    Type: String
    Description: Image cache name.
Outputs:
  ImageCacheId:
    Description: The ID of the image cache.
    Value:
      Fn::GetAtt:
      - ImageCache
      - ImageCacheId