ALIYUN::CR::ArtifactLifecycleRule

更新时间:
复制 MD 格式

ALIYUN::CR::ArtifactLifecycleRule类型用于创建制品生命周期管理规则。

语法

{
  "Type": "ALIYUN::CR::ArtifactLifecycleRule",
  "Properties": {
    "Auto": Boolean,
    "InstanceId": String,
    "NamespaceName": String,
    "RetentionTagCount": Integer,
    "RepoName": String,
    "ScheduleTime": String,
    "Scope": String,
    "TagRegexp": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

Auto

Boolean

是

是

指定是否自动执行生命周期管理规则。

无

InstanceId

String

是

否

ACR实例ID。

无

NamespaceName

String

否

是

命名空间的名称。

无

RepoName

String

否

是

镜像仓库的名称。

无

RetentionTagCount

Integer

否

是

要保留的镜像数量。

无

ScheduleTime

String

否

是

生命周期管理规则的执行周期。

无

Scope

String

否

是

删除范围。

无

TagRegexp

String

否

是

用于指示保留哪些镜像标签的正则表达式。

无

返回值

Fn::GetAtt

  • Auto:指定是否自动执行生命周期管理规则。

  • NamespaceName:命名空间的名称。

  • RetentionTagCount:要保留的镜像数量。

  • ModifiedTime:生命周期管理规则的变更时间。

  • ScheduleTime:生命周期管理规则的执行周期。

  • Scope:删除范围。

  • InstanceId:ACR实例ID。

  • TagRegexp:用于指示保留哪些镜像标签的正则表达式。

  • CreateTime:生命周期管理规则的创建时间。

  • RepoName:镜像仓库的名称。

  • ArtifactLifecycleRuleId:生命周期管理规则的ID。

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  Auto:
    Type: Boolean
    Description:
      en: Specify whether to automatically execute the lifecycle management rule.
      zh: 指定是否自动执行生命周期管理规则。
    Required: true
  RetentionTagCount:
    Type: Number
    Description:
      en: The number of images that you want to retain.
      zh: 要保留的镜像数量。
    Required: false
  ScheduleTime:
    Type: String
    Description:
      en: The execution cycle of the lifecycle management rule.
      zh: 生命周期管理规则的执行周期。
    Required: false
  Scope:
    Type: String
    Description:
      en: The deletion scope.
      zh: 删除范围。
    Required: false
  InstanceId:
    Type: String
    Description:
      en: ACR Instance ID.
      zh: ACR实例ID。
    Required: true
Resources:
  ExtensionResource:
    Type: ALIYUN::CR::ArtifactLifecycleRule
    Properties:
      Auto:
        Ref: Auto
      RetentionTagCount:
        Ref: RetentionTagCount
      ScheduleTime:
        Ref: ScheduleTime
      Scope:
        Ref: Scope
      InstanceId:
        Ref: InstanceId
Outputs:
  Auto:
    Description:
      en: Specify whether to automatically execute the lifecycle management rule.
      zh: 指定是否自动执行生命周期管理规则。
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Auto
  NamespaceName:
    Description:
      en: The name of the namespace.
      zh: 命名空间的名称。
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - NamespaceName
  RetentionTagCount:
    Description:
      en: The number of images that you want to retain.
      zh: 要保留的镜像数量。
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - RetentionTagCount
  ModifiedTime:
    Description:
      en: Change time of the lifecycle management rule.
      zh: 生命周期管理规则的变更时间。
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ModifiedTime
  ScheduleTime:
    Description:
      en: The execution cycle of the lifecycle management rule.
      zh: 生命周期管理规则的执行周期。
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ScheduleTime
  Scope:
    Description:
      en: The deletion scope.
      zh: 删除范围。
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Scope
  InstanceId:
    Description:
      en: ACR Instance ID.
      zh: ACR实例ID。
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - InstanceId
  TagRegexp:
    Description:
      en: The regular expression that is used to indicate which image tags are retained.
      zh: 用于指示保留哪些镜像标签的正则表达式。
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - TagRegexp
  CreateTime:
    Description:
      en: Creation time of the lifecycle management rule.
      zh: 生命周期管理规则的创建时间。
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - CreateTime
  RepoName:
    Description:
      en: The name of the image repository.
      zh: 镜像仓库的名称。
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - RepoName
  ArtifactLifecycleRuleId:
    Description:
      en: The ID of the lifecycle management rule.
      zh: 生命周期管理规则的ID。
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ArtifactLifecycleRuleId
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "Auto": {
      "Type": "Boolean",
      "Description": {
        "en": "Specify whether to automatically execute the lifecycle management rule.",
        "zh": "指定是否自动执行生命周期管理规则。"
      },
      "Required": true
    },
    "RetentionTagCount": {
      "Type": "Number",
      "Description": {
        "en": "The number of images that you want to retain.",
        "zh": "要保留的镜像数量。"
      },
      "Required": false
    },
    "ScheduleTime": {
      "Type": "String",
      "Description": {
        "en": "The execution cycle of the lifecycle management rule.",
        "zh": "生命周期管理规则的执行周期。"
      },
      "Required": false
    },
    "Scope": {
      "Type": "String",
      "Description": {
        "en": "The deletion scope.",
        "zh": "删除范围。"
      },
      "Required": false
    },
    "InstanceId": {
      "Type": "String",
      "Description": {
        "en": "ACR Instance ID.",
        "zh": "ACR实例ID。"
      },
      "Required": true
    }
  },
  "Resources": {
    "ExtensionResource": {
      "Type": "ALIYUN::CR::ArtifactLifecycleRule",
      "Properties": {
        "Auto": {
          "Ref": "Auto"
        },
        "RetentionTagCount": {
          "Ref": "RetentionTagCount"
        },
        "ScheduleTime": {
          "Ref": "ScheduleTime"
        },
        "Scope": {
          "Ref": "Scope"
        },
        "InstanceId": {
          "Ref": "InstanceId"
        }
      }
    }
  },
  "Outputs": {
    "Auto": {
      "Description": {
        "en": "Specify whether to automatically execute the lifecycle management rule.",
        "zh": "指定是否自动执行生命周期管理规则。"
      },
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Auto"
        ]
      }
    },
    "NamespaceName": {
      "Description": {
        "en": "The name of the namespace.",
        "zh": "命名空间的名称。"
      },
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "NamespaceName"
        ]
      }
    },
    "RetentionTagCount": {
      "Description": {
        "en": "The number of images that you want to retain.",
        "zh": "要保留的镜像数量。"
      },
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "RetentionTagCount"
        ]
      }
    },
    "ModifiedTime": {
      "Description": {
        "en": "Change time of the lifecycle management rule.",
        "zh": "生命周期管理规则的变更时间。"
      },
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ModifiedTime"
        ]
      }
    },
    "ScheduleTime": {
      "Description": {
        "en": "The execution cycle of the lifecycle management rule.",
        "zh": "生命周期管理规则的执行周期。"
      },
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ScheduleTime"
        ]
      }
    },
    "Scope": {
      "Description": {
        "en": "The deletion scope.",
        "zh": "删除范围。"
      },
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Scope"
        ]
      }
    },
    "InstanceId": {
      "Description": {
        "en": "ACR Instance ID.",
        "zh": "ACR实例ID。"
      },
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "InstanceId"
        ]
      }
    },
    "TagRegexp": {
      "Description": {
        "en": "The regular expression that is used to indicate which image tags are retained.",
        "zh": "用于指示保留哪些镜像标签的正则表达式。"
      },
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "TagRegexp"
        ]
      }
    },
    "CreateTime": {
      "Description": {
        "en": "Creation time of the lifecycle management rule.",
        "zh": "生命周期管理规则的创建时间。"
      },
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "CreateTime"
        ]
      }
    },
    "RepoName": {
      "Description": {
        "en": "The name of the image repository.",
        "zh": "镜像仓库的名称。"
      },
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "RepoName"
        ]
      }
    },
    "ArtifactLifecycleRuleId": {
      "Description": {
        "en": "The ID of the lifecycle management rule.",
        "zh": "生命周期管理规则的ID。"
      },
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ArtifactLifecycleRuleId"
        ]
      }
    }
  }
}