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

Syntax

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

Properties

PropertyTypeRequiredEditableDescriptionConstraint
NamespaceStringYesNoThe name of the namespace. The name must be 2 to 30 characters in length, and can contain lowercase letters, digits, hyphens (-), and underscores (_). The name cannot start with a hyphen (-) or underscore (_).
DefaultVisibilityStringNoYesThe default repository type. Valid values:
  • PUBLIC
  • PRIVATE
AutoCreateBooleanNoYesSpecifies whether the system automatically creates a repository. Valid values:
  • true: The system automatically creates a repository.
  • false: You manually create a repository.
InstanceIdStringNoNoThe ID of the instance. Example: cri-xkx6vujuhay0****.

Return values

Fn::GetAtt

  • NamespaceId: the ID of the namespace.
  • InstanceId: the ID of the instance.
  • Namespace: the name of the namespace.

Examples

  • YAMLformat

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters: {}
    Resources:
      NameSpace:
        Type: ALIYUN::CR::Namespace
        Properties:
          AutoCreate: false
          DefaultVisibility: PRIVATE
          Namespace: TestNamespace
    Outputs:
      NamespaceId:
        Description: The namespace id
        Value:
          Fn::GetAtt:
            - NameSpace
            - NamespaceId
  • JSONformat

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
      },
      "Resources": {
        "NameSpace": {
          "Type": "ALIYUN::CR::Namespace",
          "Properties": {
            "AutoCreate": false,
            "DefaultVisibility": "PRIVATE",
            "Namespace": "TestNamespace"
          }
        }
      },
      "Outputs": {
        "NamespaceId": {
          "Description": "The namespace id",
          "Value": {
            "Fn::GetAtt": [
              "NameSpace",
              "NamespaceId"
            ]
          }
        }
      }
    }