{
 "additionalProperties": false,
 "createOnlyProperties": [
  "/properties/KmsKeyId",
  "/properties/Port",
  "/properties/SnapshotArns",
  "/properties/SnapshotName",
  "/properties/CacheSubnetGroupName",
  "/properties/NetworkType",
  "/properties/DataTieringEnabled",
  "/properties/AtRestEncryptionEnabled",
  "/properties/ReplicationGroupId",
  "/properties/GlobalReplicationGroupId",
  "/properties/ReplicasPerNodeGroup",
  "/properties/PreferredCacheClusterAZs"
 ],
 "definitions": {
  "CloudWatchLogsDestinationDetails": {
   "additionalProperties": false,
   "properties": {
    "LogGroup": {
     "type": "string"
    }
   },
   "required": [
    "LogGroup"
   ],
   "type": "object"
  },
  "DestinationDetails": {
   "additionalProperties": false,
   "properties": {
    "CloudWatchLogsDetails": {
     "$ref": "#/definitions/CloudWatchLogsDestinationDetails"
    },
    "KinesisFirehoseDetails": {
     "$ref": "#/definitions/KinesisFirehoseDestinationDetails"
    }
   },
   "type": "object"
  },
  "KinesisFirehoseDestinationDetails": {
   "additionalProperties": false,
   "properties": {
    "DeliveryStream": {
     "type": "string"
    }
   },
   "required": [
    "DeliveryStream"
   ],
   "type": "object"
  },
  "LogDeliveryConfigurationRequest": {
   "additionalProperties": false,
   "properties": {
    "DestinationDetails": {
     "$ref": "#/definitions/DestinationDetails"
    },
    "DestinationType": {
     "enum": [
      "cloudwatch-logs",
      "kinesis-firehose"
     ],
     "enumCaseInsensitive": [
      "cloudwatch-logs",
      "kinesis-firehose"
     ],
     "type": "string"
    },
    "LogFormat": {
     "enum": [
      "json",
      "text"
     ],
     "enumCaseInsensitive": [
      "json",
      "text"
     ],
     "type": "string"
    },
    "LogType": {
     "enum": [
      "engine-log",
      "slow-log"
     ],
     "enumCaseInsensitive": [
      "engine-log",
      "slow-log"
     ],
     "type": "string"
    }
   },
   "required": [
    "LogFormat",
    "LogType",
    "DestinationType",
    "DestinationDetails"
   ],
   "type": "object"
  },
  "NodeGroupConfiguration": {
   "additionalProperties": false,
   "properties": {
    "NodeGroupId": {
     "maxLength": 4,
     "minLength": 1,
     "pattern": "^\\d+$",
     "type": "string"
    },
    "PrimaryAvailabilityZone": {
     "type": "string"
    },
    "ReplicaAvailabilityZones": {
     "items": {
      "type": "string"
     },
     "type": "array",
     "uniqueItems": true
    },
    "ReplicaCount": {
     "type": "integer"
    },
    "Slots": {
     "type": "string"
    }
   },
   "type": "object"
  },
  "Tag": {
   "additionalProperties": false,
   "properties": {
    "Key": {
     "type": "string"
    },
    "Value": {
     "type": "string"
    }
   },
   "required": [
    "Value",
    "Key"
   ],
   "type": "object"
  }
 },
 "primaryIdentifier": [
  "/properties/ReplicationGroupId"
 ],
 "properties": {
  "AtRestEncryptionEnabled": {
   "type": "boolean"
  },
  "AuthToken": {
   "type": "string"
  },
  "AutoMinorVersionUpgrade": {
   "type": "boolean"
  },
  "AutomaticFailoverEnabled": {
   "type": "boolean"
  },
  "CacheNodeType": {
   "type": "string"
  },
  "CacheParameterGroupName": {
   "type": "string"
  },
  "CacheSecurityGroupNames": {
   "items": {
    "type": "string"
   },
   "type": "array",
   "uniqueItems": true
  },
  "CacheSubnetGroupName": {
   "type": "string"
  },
  "ClusterMode": {
   "enum": [
    "compatible",
    "Compatible",
    "disabled",
    "Disabled",
    "enabled",
    "Enabled"
   ],
   "enumCaseInsensitive": [
    "compatible",
    "disabled",
    "enabled"
   ],
   "type": "string"
  },
  "ConfigurationEndPoint": {
   "properties": {
    "Address": {
     "type": "string"
    },
    "Port": {
     "type": "string"
    }
   },
   "type": "object"
  },
  "DataTieringEnabled": {
   "type": "boolean"
  },
  "Engine": {
   "type": "string"
  },
  "EngineVersion": {
   "type": "string"
  },
  "GlobalReplicationGroupId": {
   "type": "string"
  },
  "IpDiscovery": {
   "enum": [
    "ipv4",
    "ipv6"
   ],
   "enumCaseInsensitive": [
    "ipv4",
    "ipv6"
   ],
   "type": "string"
  },
  "KmsKeyId": {
   "anyOf": [
    {
     "format": "AWS::KMS::Key.Arn"
    },
    {
     "format": "AWS::KMS::Key.Id"
    },
    {
     "format": "AWS::KMS::Alias.AliasName"
    }
   ],
   "type": "string"
  },
  "LogDeliveryConfigurations": {
   "items": {
    "$ref": "#/definitions/LogDeliveryConfigurationRequest"
   },
   "type": "array",
   "uniqueItems": true
  },
  "MultiAZEnabled": {
   "type": "boolean"
  },
  "NetworkType": {
   "enum": [
    "dual_stack",
    "ipv4",
    "ipv6"
   ],
   "enumCaseInsensitive": [
    "dual_stack",
    "ipv4",
    "ipv6"
   ],
   "type": "string"
  },
  "NodeGroupConfiguration": {
   "items": {
    "$ref": "#/definitions/NodeGroupConfiguration"
   },
   "type": "array",
   "uniqueItems": true
  },
  "NotificationTopicArn": {
   "type": "string"
  },
  "NumCacheClusters": {
   "maximum": 6,
   "minimum": 1,
   "type": "integer"
  },
  "NumNodeGroups": {
   "type": "integer"
  },
  "Port": {
   "type": "integer"
  },
  "PreferredCacheClusterAZs": {
   "items": {
    "type": "string"
   },
   "type": "array",
   "uniqueItems": true
  },
  "PreferredMaintenanceWindow": {
   "type": "string"
  },
  "PrimaryClusterId": {
   "type": "string"
  },
  "PrimaryEndPoint": {
   "properties": {
    "Address": {
     "type": "string"
    },
    "Port": {
     "type": "string"
    }
   },
   "type": "object"
  },
  "ReadEndPoint": {
   "properties": {
    "Addresses": {
     "type": "string"
    },
    "Ports": {
     "type": "string"
    }
   },
   "type": "object"
  },
  "ReaderEndPoint": {
   "properties": {
    "Address": {
     "type": "string"
    },
    "Port": {
     "type": "string"
    }
   },
   "type": "object"
  },
  "ReplicasPerNodeGroup": {
   "maximum": 5,
   "minimum": 0,
   "type": "integer"
  },
  "ReplicationGroupDescription": {
   "type": "string"
  },
  "ReplicationGroupId": {
   "type": "string"
  },
  "SecurityGroupIds": {
   "format": "AWS::EC2::SecurityGroup.Ids",
   "items": {
    "format": "AWS::EC2::SecurityGroup.Id",
    "type": "string"
   },
   "type": "array",
   "uniqueItems": true
  },
  "SnapshotArns": {
   "items": {
    "type": "string"
   },
   "type": "array",
   "uniqueItems": true
  },
  "SnapshotName": {
   "type": "string"
  },
  "SnapshotRetentionLimit": {
   "type": "integer"
  },
  "SnapshotWindow": {
   "type": "string"
  },
  "SnapshottingClusterId": {
   "type": "string"
  },
  "Tags": {
   "items": {
    "$ref": "#/definitions/Tag"
   },
   "type": "array",
   "uniqueItems": false
  },
  "TransitEncryptionEnabled": {
   "type": "boolean"
  },
  "TransitEncryptionMode": {
   "enum": [
    "preferred",
    "required"
   ],
   "enumCaseInsensitive": [
    "preferred",
    "required"
   ],
   "type": "string"
  },
  "UserGroupIds": {
   "items": {
    "minLength": 1,
    "pattern": "^[a-zA-Z][a-zA-Z0-9\\-]*$",
    "type": "string"
   },
   "minItems": 1,
   "type": "array",
   "uniqueItems": true
  }
 },
 "readOnlyProperties": [
  "/properties/ConfigurationEndPoint/Address",
  "/properties/PrimaryEndPoint/Address",
  "/properties/PrimaryEndPoint/Port",
  "/properties/ReaderEndPoint/Address",
  "/properties/ConfigurationEndPoint/Port",
  "/properties/ReaderEndPoint/Port",
  "/properties/ReadEndPoint/Addresses",
  "/properties/ReadEndPoint/Ports",
  "/properties/ReplicationGroupId"
 ],
 "required": [
  "ReplicationGroupDescription"
 ],
 "typeName": "AWS::ElastiCache::ReplicationGroup"
}
