ALIYUN::CR::Repository is used to create an image repository.

Syntax

{
  "Type": "ALIYUN::CR::Repository",
  "Properties": {
    "RepoNamespace": String,
    "Summary": String,
    "RepoType": String,
    "Detail": String,
    "RepoName": String,
    "RepoSource": Map,
    "InstanceId": String,
    "TagImmutability": Boolean
  }
}

Properties

Property Type Required Editable Description Constraint
RepoNamespace String Yes No The namespace to which the image repository belongs. None.
Summary String Yes Yes The summary of the image repository. The summary must be 1 to 100 characters in length.
RepoType String Yes Yes The type of the image repository. Valid values:
  • PUBLIC: the public image repository. Public image repositories support anonymous downloads.
  • PRIVATE: the private image repository. You must log on to private image repositories before you download images from the repositories.
Detail String No Yes The description of the image repository. The Markdown format is supported. The description can be up to 2,000 characters in length.
RepoName String Yes No The name of the image repository. The name must be 2 to 64 characters in length, and can contain lowercase letters, digits, periods (.), hyphens (-), and underscores (_).
RepoSource Map No No The source code repository and image build settings of the image repository. For more information, see RepoSource properties.
InstanceId String No No The ID of the instance. Example: cri-xkx6vujuhay0****.
TagImmutability Boolean No Yes Specifies whether the tag that is bound to the image repository is immutable. Valid values:
  • true: The tag is immutable.
  • false: The tag is mutable.

RepoSource syntax

"RepoSource": {
  "SourceRepoNamespace": String,
  "SourceRepoName": String,
  "IsOversea": Boolean,
  "IsDisableCache": Boolean,
  "SourceRepoType": String,
  "IsAutoBuild": Boolean
}

RepoSource properties

Property Type Required Editable Description Constraint
SourceRepoNamespace String Yes No The namespace to which the source code repository belongs. None.
SourceRepoName String Yes No The name of the source code repository. None.
IsOversea Boolean Yes No Specifies whether to enable image build in data centers outside the Chinese mainland. Valid values:
  • true: enables the feature.
  • false: disable the feature.
IsDisableCache Boolean Yes No Specifies whether to disable cache for image build. Valid values:
  • true: disables the feature.
  • false: enables the feature.
SourceRepoType String Yes No The type of the source code repository. Valid values:
  • PUBLIC
  • PRIVATE
IsAutoBuild Boolean Yes No Specifies whether to enable automatic image build when code changes. Valid values:
  • true: enables the feature.
  • false: disables the feature.

Return values

Fn::GetAtt

  • RepoId: the ID of the image repository.
  • RepoName: the name of the image repository.
  • InstanceId: the ID of the instance.
  • RepoType: the type of the image repository.
  • RepoNamespace: the name of the image repository namespace.

Examples

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "RepoNamespace": {
      "Type": "String",
      "Description": "the namespace the repo belongs to",
      "MinLength": 2,
      "MaxLength": 30
    },
    "RepoType": {
      "Type": "String",
      "Description": "repository visibility, public or private",
      "AllowedValues": [
        "PUBLIC",
        "PRIVATE"
      ]
    },
    "RepoName": {
      "Type": "String",
      "Description": "the name of the repo",
      "MinLength": 1,
      "MaxLength": 64
    },
    "Summary": {
      "Type": "String",
      "Description": "description or something alike",
      "MinLength": 1,
      "MaxLength": 100
    },
    "Detail": {
      "Type": "String",
      "Description": "detailed configuration in markdown format",
      "MaxLength": 2000
    },
    "RepoSource": {
      "Type": "Json",
      "Description": "Code Source message. "
    }
  },
  "Resources": {
    "Repository": {
      "Type": "ALIYUN::CR::Repository",
      "Properties": {
        "RepoNamespace": {
          "Ref": "RepoNamespace"
        },
        "RepoType": {
          "Ref": "RepoType"
        },
        "RepoName": {
          "Ref": "RepoName"
        },
        "Summary": {
          "Ref": "Summary"
        },
        "Detail": {
          "Ref": "Detail"
        },
        "RepoSource": {
          "Ref": "RepoSource"
        }
      }
    }
  },
  "Outputs": {
    "RepoId": {
      "Description": "The repo id",
      "Value": {
        "Fn::GetAtt": [
          "Repository",
          "RepoId"
        ]
      }
    }
  }
}

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  Detail:
    Description: detailed configuration in markdown format
    MaxLength: 2000
    Type: String
  RepoName:
    Description: the name of the repo
    MaxLength: 64
    MinLength: 1
    Type: String
  RepoNamespace:
    Description: the namespace the repo belongs to
    MaxLength: 30
    MinLength: 2
    Type: String
  RepoSource:
    Description: 'Code Source message. '
    Type: Json
  RepoType:
    AllowedValues:
    - PUBLIC
    - PRIVATE
    Description: repository visibility, public or private
    Type: String
  Summary:
    Description: description or something alike
    MaxLength: 100
    MinLength: 1
    Type: String
Resources:
  Repository:
    Properties:
      Detail:
        Ref: Detail
      RepoName:
        Ref: RepoName
      RepoNamespace:
        Ref: RepoNamespace
      RepoSource:
        Ref: RepoSource
      RepoType:
        Ref: RepoType
      Summary:
        Ref: Summary
    Type: ALIYUN::CR::Repository
Outputs:
  RepoId:
    Description: The repo id
    Value:
      Fn::GetAtt:
      - Repository
      - RepoId

To view more examples, visit Repository.json and Repository.yml.