Repository: getmoto/moto

Issue:
Redshift restore_from_cluster_snapshot should fail if cluster already exist
moto: `1.3.14` via pip running non-server
boto: `2.49.0`
boto3: `1.13.2`
botocore: `1.16.2`
python `3.8.2`
Windows 10

Following the documentation from AWS: [Redshift.Client.restore_from_cluster_snapshot](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/redshift.html#Redshift.Client.restore_from_cluster_snapshot)

## How to reproduce 

```python
@mock_redshift
def test_cluster_already_exist():
    mock_cluster_id = "mock_cluster"
    mock_cluster_snapshot_id = "mock_cluster_snapshot_1"
    restore_cluster_az = "us-east-1b"
    redshift_client = boto3.client('redshift')
    redshift_client.create_cluster(
        DBName="test-db",
        ClusterIdentifier=mock_cluster_id,
        ClusterType="single-node",
        NodeType="ds2.xlarge",
        MasterUsername="username",
        MasterUserPassword="password",
    )
    redshift_client.create_cluster_snapshot(
        SnapshotIdentifier=mock_cluster_snapshot_id, ClusterIdentifier=mock_cluster_id
    )
    redshift_client.restore_from_cluster_snapshot.when.called_with(
        ClusterIdentifier=mock_cluster_id,
        SnapshotIdentifier=mock_cluster_snapshot_id,
        AvailabilityZone=restore_cluster_az
    ).should.throw(ClientError, "ClusterAlreadyExists")
```

## Expectation

`client.restore_from_cluster_snapshot` should throw a `ClientError` exception saying a cluster with the same ID already exist

##  Actual

`client.restore_from_cluster_snapshot` does not throw a `ClientError` exception, but proceeds into creating the cluster.




Discussion:
Thanks for raising this @kennedy - will mark this as an enhancement

Resolving patch:
diff --git a/moto/redshift/exceptions.py b/moto/redshift/exceptions.py
--- a/moto/redshift/exceptions.py
+++ b/moto/redshift/exceptions.py
@@ -136,3 +136,10 @@ def __init__(self, cluster_identifier):
                 cluster_identifier
             ),
         )
+
+
+class ClusterAlreadyExistsFaultError(RedshiftClientError):
+    def __init__(self):
+        super(ClusterAlreadyExistsFaultError, self).__init__(
+            "ClusterAlreadyExists", "Cluster already exists"
+        )
diff --git a/moto/redshift/models.py b/moto/redshift/models.py
--- a/moto/redshift/models.py
+++ b/moto/redshift/models.py
@@ -10,6 +10,7 @@
 from moto.core.utils import iso_8601_datetime_with_milliseconds
 from moto.ec2 import ec2_backends
 from .exceptions import (
+    ClusterAlreadyExistsFaultError,
     ClusterNotFoundError,
     ClusterParameterGroupNotFoundError,
     ClusterSecurityGroupNotFoundError,
@@ -580,6 +581,8 @@ def modify_snapshot_copy_retention_period(
 
     def create_cluster(self, **cluster_kwargs):
         cluster_identifier = cluster_kwargs["cluster_identifier"]
+        if cluster_identifier in self.clusters:
+            raise ClusterAlreadyExistsFaultError()
         cluster = Cluster(self, **cluster_kwargs)
         self.clusters[cluster_identifier] = cluster
         return cluster


Test patch:
diff --git a/tests/test_redshift/test_redshift.py b/tests/test_redshift/test_redshift.py
--- a/tests/test_redshift/test_redshift.py
+++ b/tests/test_redshift/test_redshift.py
@@ -915,6 +915,11 @@ def test_create_cluster_from_snapshot():
         ClusterIdentifier=original_cluster_identifier,
     )
 
+    client.restore_from_cluster_snapshot.when.called_with(
+        ClusterIdentifier=original_cluster_identifier,
+        SnapshotIdentifier=original_snapshot_identifier,
+    ).should.throw(ClientError, "ClusterAlreadyExists")
+
     response = client.restore_from_cluster_snapshot(
         ClusterIdentifier=new_cluster_identifier,
         SnapshotIdentifier=original_snapshot_identifier,
@@ -1333,3 +1338,20 @@ def test_modify_snapshot_copy_retention_period():
     response = client.describe_clusters(ClusterIdentifier="test")
     cluster_snapshot_copy_status = response["Clusters"][0]["ClusterSnapshotCopyStatus"]
     cluster_snapshot_copy_status["RetentionPeriod"].should.equal(5)
+
+
+@mock_redshift
+def test_create_duplicate_cluster_fails():
+    kwargs = {
+        "ClusterIdentifier": "test",
+        "ClusterType": "single-node",
+        "DBName": "test",
+        "MasterUsername": "user",
+        "MasterUserPassword": "password",
+        "NodeType": "ds2.xlarge",
+    }
+    client = boto3.client("redshift", region_name="us-east-1")
+    client.create_cluster(**kwargs)
+    client.create_cluster.when.called_with(**kwargs).should.throw(
+        ClientError, "ClusterAlreadyExists"
+    )