{
  "typeName" : "AWS::ElastiCache::GlobalReplicationGroup",
  "description" : "The AWS::ElastiCache::GlobalReplicationGroup resource creates an Amazon ElastiCache Global Replication Group.",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-elasticache",
  "definitions" : {
    "GlobalReplicationGroupMember" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "ReplicationGroupId" : {
          "description" : "Regionally unique identifier for the member i.e. ReplicationGroupId.",
          "type" : "string"
        },
        "ReplicationGroupRegion" : {
          "description" : "The AWS region of the Global Datastore member.",
          "type" : "string"
        },
        "Role" : {
          "description" : "Indicates the role of the member, primary or secondary.",
          "type" : "string",
          "enum" : [ "PRIMARY", "SECONDARY" ]
        }
      }
    },
    "ReshardingConfiguration" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "NodeGroupId" : {
          "description" : "Unique identifier for the Node Group. This is either auto-generated by ElastiCache (4-digit id) or a user supplied id.",
          "type" : "string"
        },
        "PreferredAvailabilityZones" : {
          "description" : "A list of preferred availability zones for the nodes of new node groups.",
          "type" : "array",
          "uniqueItems" : false,
          "items" : {
            "type" : "string"
          }
        }
      }
    },
    "RegionalConfiguration" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "ReplicationGroupId" : {
          "description" : "The replication group id of the Global Datastore member.",
          "type" : "string"
        },
        "ReplicationGroupRegion" : {
          "description" : "The AWS region of the Global Datastore member.",
          "type" : "string"
        },
        "ReshardingConfigurations" : {
          "description" : "A list of PreferredAvailabilityZones objects that specifies the configuration of a node group in the resharded cluster. ",
          "type" : "array",
          "uniqueItems" : true,
          "items" : {
            "$ref" : "#/definitions/ReshardingConfiguration"
          }
        }
      }
    }
  },
  "properties" : {
    "GlobalReplicationGroupIdSuffix" : {
      "description" : "The suffix name of a Global Datastore. Amazon ElastiCache automatically applies a prefix to the Global Datastore ID when it is created. Each AWS Region has its own prefix. ",
      "type" : "string"
    },
    "AutomaticFailoverEnabled" : {
      "description" : "AutomaticFailoverEnabled",
      "type" : "boolean"
    },
    "CacheNodeType" : {
      "description" : "The cache node type of the Global Datastore",
      "type" : "string"
    },
    "EngineVersion" : {
      "description" : "The engine version of the Global Datastore.",
      "type" : "string"
    },
    "CacheParameterGroupName" : {
      "description" : "Cache parameter group name to use for the new engine version. This parameter cannot be modified independently.",
      "type" : "string"
    },
    "GlobalNodeGroupCount" : {
      "description" : "Indicates the number of node groups in the Global Datastore.",
      "type" : "integer"
    },
    "GlobalReplicationGroupDescription" : {
      "description" : "The optional description of the Global Datastore",
      "type" : "string"
    },
    "GlobalReplicationGroupId" : {
      "description" : "The name of the Global Datastore, it is generated by ElastiCache adding a prefix to GlobalReplicationGroupIdSuffix.",
      "type" : "string"
    },
    "Members" : {
      "description" : "The replication groups that comprise the Global Datastore.",
      "type" : "array",
      "uniqueItems" : true,
      "items" : {
        "$ref" : "#/definitions/GlobalReplicationGroupMember"
      },
      "minItems" : 1
    },
    "Status" : {
      "description" : "The status of the Global Datastore",
      "type" : "string"
    },
    "RegionalConfigurations" : {
      "description" : "Describes the replication group IDs, the AWS regions where they are stored and the shard configuration for each that comprise the Global Datastore ",
      "type" : "array",
      "uniqueItems" : true,
      "items" : {
        "$ref" : "#/definitions/RegionalConfiguration"
      }
    }
  },
  "additionalProperties" : false,
  "readOnlyProperties" : [ "/properties/GlobalReplicationGroupId", "/properties/Status" ],
  "writeOnlyProperties" : [ "/properties/GlobalReplicationGroupIdSuffix", "/properties/AutomaticFailoverEnabled", "/properties/CacheNodeType", "/properties/EngineVersion", "/properties/GlobalNodeGroupCount", "/properties/GlobalReplicationGroupDescription", "/properties/RegionalConfigurations" ],
  "required" : [ "Members" ],
  "primaryIdentifier" : [ "/properties/GlobalReplicationGroupId" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "elasticache:CreateGlobalReplicationGroup", "elasticache:DescribeGlobalReplicationGroups" ]
    },
    "read" : {
      "permissions" : [ "elasticache:DescribeGlobalReplicationGroups" ]
    },
    "update" : {
      "permissions" : [ "elasticache:ModifyGlobalReplicationGroup", "elasticache:FailoverGlobalReplicationGroup", "elasticache:DescribeGlobalReplicationGroups", "elasticache:IncreaseNodeGroupsInGlobalReplicationGroup", "elasticache:DecreaseNodeGroupsInGlobalReplicationGroup", "elasticache:DisassociateGlobalReplicationGroup", "elasticache:RebalanceSlotsInGlobalReplicationGroup" ]
    },
    "delete" : {
      "permissions" : [ "elasticache:DeleteGlobalReplicationGroup", "elasticache:DisassociateGlobalReplicationGroup", "elasticache:DescribeGlobalReplicationGroups" ]
    },
    "list" : {
      "permissions" : [ "elasticache:DescribeGlobalReplicationGroups" ]
    }
  }
}