Todos os produtos
Search
Central de documentação

Resource Orchestration Service:ALIYUN::CR::ArtifactLifecycleRule

Última atualização: Jun 27, 2026

Cria uma regra de gerenciamento de ciclo de vida de artefatos para o Container Registry (ACR).

Sintaxe

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

Propriedades

Parâmetro

Tipo

Obrigatório

Atualização permitida

Descrição

Restrições

Auto

Boolean

Sim

Sim

Define se a regra executa automaticamente.

Nenhuma

InstanceId

String

Sim

Não

ID da instância do ACR.

Nenhuma

NamespaceName

String

Não

Sim

Nome do namespace.

Nenhuma

RepoName

String

Não

Sim

Nome do repositório de imagens.

Nenhuma

RetentionTagCount

Integer

Não

Sim

Número de imagens a reter.

Nenhuma

ScheduleTime

String

Não

Sim

Agendamento de execução da regra de gerenciamento de ciclo de vida.

Nenhuma

Scope

String

Não

Sim

Escopo de exclusão.

Nenhuma

TagRegexp

String

Não

Sim

Expressão regular que define as tags de imagem a reter.

Nenhuma

Valores de retorno

Fn::GetAtt

  • Auto: Indica se a regra executa automaticamente.

  • NamespaceName: Nome do namespace.

  • RetentionTagCount: Número de imagens a reter.

  • ModifiedTime: Data e hora da última modificação da regra.

  • ScheduleTime: Agendamento de execução da regra.

  • Scope: Escopo de exclusão.

  • InstanceId: ID da instância do ACR.

  • TagRegexp: Expressão regular que define as tags de imagem a reter.

  • CreateTime: Data e hora de criação da regra.

  • RepoName: Nome do repositório de imagens.

  • ArtifactLifecycleRuleId: ID da regra.

Exemplos

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  Auto:
    Type: Boolean
    Description: Specifies whether to automatically execute the lifecycle management rule.
    Required: true
  RetentionTagCount:
    Type: Number
    Description: The number of images that you want to retain.
    Required: false
  ScheduleTime:
    Type: String
    Description: The execution schedule of the lifecycle management rule.
    Required: false
  Scope:
    Type: String
    Description: The deletion scope.
    Required: false
  InstanceId:
    Type: String
    Description: The ID of the ACR instance.
    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: Indicates whether the lifecycle management rule runs automatically.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Auto
  NamespaceName:
    Description: The name of the namespace.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - NamespaceName
  RetentionTagCount:
    Description: The number of images to retain.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - RetentionTagCount
  ModifiedTime:
    Description: The time when the lifecycle management rule was last modified.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ModifiedTime
  ScheduleTime:
    Description: The execution schedule of the lifecycle management rule.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ScheduleTime
  Scope:
    Description: The deletion scope.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Scope
  InstanceId:
    Description: The ID of the ACR instance.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - InstanceId
  TagRegexp:
    Description: The regular expression that indicates which image tags are retained.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - TagRegexp
  CreateTime:
    Description: The time when the lifecycle management rule was created.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - CreateTime
  RepoName:
    Description: The name of the image repository.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - RepoName
  ArtifactLifecycleRuleId:
    Description: The ID of the lifecycle management rule.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ArtifactLifecycleRuleId
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "Auto": {
      "Type": "Boolean",
      "Description": "Specifies whether to automatically execute the lifecycle management rule.",
      "Required": true
    },
    "RetentionTagCount": {
      "Type": "Number",
      "Description": "The number of images that you want to retain.",
      "Required": false
    },
    "ScheduleTime": {
      "Type": "String",
      "Description": "The execution schedule of the lifecycle management rule.",
      "Required": false
    },
    "Scope": {
      "Type": "String",
      "Description": "The deletion scope.",
      "Required": false
    },
    "InstanceId": {
      "Type": "String",
      "Description": "The ID of the ACR instance.",
      "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": "Indicates whether the lifecycle management rule runs automatically.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Auto"
        ]
      }
    },
    "NamespaceName": {
      "Description": "The name of the namespace.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "NamespaceName"
        ]
      }
    },
    "RetentionTagCount": {
      "Description": "The number of images to retain.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "RetentionTagCount"
        ]
      }
    },
    "ModifiedTime": {
      "Description": "The time when the lifecycle management rule was last modified.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ModifiedTime"
        ]
      }
    },
    "ScheduleTime": {
      "Description": "The execution schedule of the lifecycle management rule.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ScheduleTime"
        ]
      }
    },
    "Scope": {
      "Description": "The deletion scope.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Scope"
        ]
      }
    },
    "InstanceId": {
      "Description": "The ID of the ACR instance.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "InstanceId"
        ]
      }
    },
    "TagRegexp": {
      "Description": "The regular expression that indicates which image tags are retained.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "TagRegexp"
        ]
      }
    },
    "CreateTime": {
      "Description": "The time when the lifecycle management rule was created.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "CreateTime"
        ]
      }
    },
    "RepoName": {
      "Description": "The name of the image repository.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "RepoName"
        ]
      }
    },
    "ArtifactLifecycleRuleId": {
      "Description": "The ID of the lifecycle management rule.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ArtifactLifecycleRuleId"
        ]
      }
    }
  }
}