{
  "typeName" : "AWS::DocDB::GlobalCluster",
  "description" : "The AWS::DocDB::GlobalCluster resource represents an Amazon DocumentDB Global Cluster.",
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : true,
    "tagProperty" : "/properties/Tags",
    "permissions" : [ "rds:AddTagsToResource", "rds:ListTagsForResource", "rds:RemoveTagsFromResource" ]
  },
  "properties" : {
    "GlobalClusterIdentifier" : {
      "description" : "The cluster identifier of the global cluster.",
      "type" : "string",
      "pattern" : "^[a-zA-Z]{1}(?:-?[a-zA-Z0-9]){0,62}$",
      "minLength" : 1,
      "maxLength" : 63
    },
    "SourceDBClusterIdentifier" : {
      "description" : "The Amazon Resource Name (ARN) to use as the primary cluster of the global cluster. You may also choose to instead specify the DBClusterIdentifier. If you provide a value for this parameter, don't specify values for the following settings because Amazon DocumentDB uses the values from the specified source DB cluster: Engine, EngineVersion, StorageEncrypted",
      "type" : "string",
      "oneOf" : [ {
        "pattern" : "^[a-zA-Z]{1}(?:-?[a-zA-Z0-9]){0,62}$"
      }, {
        "pattern" : "^(?=.{40,128}$)arn.*"
      } ]
    },
    "Engine" : {
      "description" : "The database engine to use for this global cluster.",
      "type" : "string",
      "default" : "docdb",
      "enum" : [ "docdb" ]
    },
    "EngineVersion" : {
      "description" : "The engine version to use for this global cluster.",
      "type" : "string"
    },
    "DeletionProtection" : {
      "description" : "Indicates whether the global cluster has deletion protection enabled. The global cluster can't be deleted when deletion protection is enabled.",
      "type" : "boolean"
    },
    "StorageEncrypted" : {
      "description" : "Indicates whether the global cluster has storage encryption enabled.",
      "type" : "boolean"
    },
    "Tags" : {
      "type" : "array",
      "maxItems" : 50,
      "uniqueItems" : true,
      "insertionOrder" : false,
      "description" : "The tags to be assigned to the Amazon DocumentDB resource.",
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    },
    "GlobalClusterResourceId" : {
      "description" : "The AWS Region-unique, immutable identifier for the global database cluster. This identifier is found in AWS CloudTrail log entries whenever the AWS KMS key for the DB cluster is accessed.",
      "type" : "string"
    },
    "GlobalClusterArn" : {
      "description" : "The Amazon Resource Name (ARN) for the global cluster.",
      "type" : "string"
    }
  },
  "definitions" : {
    "Tag" : {
      "description" : "A key-value pair to associate with an Amazon DocumentDB resource.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Key" : {
          "type" : "string",
          "description" : "The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ",
          "minLength" : 1,
          "maxLength" : 128
        },
        "Value" : {
          "type" : "string",
          "description" : "The value for the tag. You can specify a value that is 0 to 256 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ",
          "minLength" : 0,
          "maxLength" : 256
        }
      },
      "required" : [ "Key", "Value" ]
    }
  },
  "additionalProperties" : false,
  "propertyTransform" : {
    "/properties/GlobalClusterIdentifier" : "$lowercase(GlobalClusterIdentifier)"
  },
  "required" : [ "GlobalClusterIdentifier" ],
  "oneOf" : [ {
    "required" : [ "Engine" ]
  }, {
    "required" : [ "SourceDBClusterIdentifier" ]
  } ],
  "createOnlyProperties" : [ "/properties/Engine", "/properties/EngineVersion", "/properties/GlobalClusterIdentifier", "/properties/SourceDBClusterIdentifier", "/properties/StorageEncrypted" ],
  "readOnlyProperties" : [ "/properties/GlobalClusterArn", "/properties/GlobalClusterResourceId" ],
  "writeOnlyProperties" : [ "/properties/SourceDBClusterIdentifier" ],
  "primaryIdentifier" : [ "/properties/GlobalClusterIdentifier" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "rds:CreateGlobalCluster", "rds:DescribeGlobalClusters", "rds:DescribeDBClusters", "rds:AddTagsToResource", "rds:ListTagsForResource" ]
    },
    "read" : {
      "permissions" : [ "rds:DescribeGlobalClusters", "rds:ListTagsForResource" ]
    },
    "update" : {
      "permissions" : [ "rds:ModifyGlobalCluster", "rds:DescribeGlobalClusters", "rds:AddTagsToResource", "rds:ListTagsForResource", "rds:RemoveTagsFromResource" ]
    },
    "delete" : {
      "permissions" : [ "rds:DeleteGlobalCluster", "rds:DescribeGlobalClusters", "rds:RemoveFromGlobalCluster", "rds:DescribeDBClusters" ]
    },
    "list" : {
      "permissions" : [ "rds:DescribeGlobalClusters", "rds:ListTagsForResource" ]
    }
  }
}