ALIYUN::CR::Namespace is used to create a namespace.

Syntax

{
  "Type": "ALIYUN::CR::Namespace",
  "Properties": {
    "Namespace": String,
    "DefaultVisibility": String,
    "AutoCreate": Boolean
  }
}

Properties

Name Type Required Editable Description Validity
Namespace String Yes No The name of the namespace. The name must be 2 to 30 characters in length and can contain lowercase letters, digits, hyphens (-), and underscores (_). It cannot start with a hyphen or an underscore. None.
DefaultVisibility String No Yes The default type of a repository. Valid values: PUBLIC and PRIVATE.
AutoCreate Boolean No Yes Specifies whether to automatically create a repository. None.

Response parameters

Fn::GetAtt

  • NamespaceId: the ID of the namespace.

Examples

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Resources": {
    "Namespace": {
      "Type": "ALIYUN::CR::Namespace",
      "Properties": {
        "Namespace": {
          "Ref": "Namespace"
        },
        "DefaultVisibility": {
          "Ref": "DefaultVisibility"
        },
        "AutoCreate": {
          "Ref": "AutoCreate"
        }
      }
    }
  },
  "Parameters": {
    "Namespace": {
      "MinLength": 2,
      "Type": "String",
      "Description": "domain name",
      "MaxLength": 30
    },
    "DefaultVisibility": {
      "Default": "PRIVATE",
      "Type": "String",
      "Description": "repository default visibility, public or private",
      "AllowedValues": [
        "PUBLIC",
        "PRIVATE"
      ]
    },
    "AutoCreate": {
      "Default": true,
      "Type": "Boolean",
      "Description": "whether auto create repository",
      "AllowedValues": [
        "True",
        "true",
        "False",
        "false"
      ]
    }
  },
  "Outputs": {
    "NamespaceId": {
      "Description": "The namespace id",
      "Value": {
        "Fn::GetAtt": [
          "Namespace",
          "NamespaceId"
        ]
      }
    }
  }
}