01 Run describe-clusters command (OSX/Linux/UNIX) to describe the configuration information for the Amazon Redshift cluster that you want to reconfigure (see Audit section part II to identify the right cluster):
aws redshift describe-clusters
--region us-east-1
--cluster-identifier cc-redshift-cluster
02 The command output should return the requested configuration information which will be useful later when the new Redshift cluster will be launched:
{
"Clusters": [
{
"PubliclyAccessible": true,
"MasterUsername": "ccclusterusr",
"VpcSecurityGroups": [
{
"Status": "active",
"VpcSecurityGroupId": "sg-541e2e7b"
}
],
"ClusterPublicKey": "ssh-rsa AAAAB3NzaC ... ",
"NumberOfNodes": 1,
"PendingModifiedValues": {},
"VpcId": "vpc-d731653f",
"ClusterVersion": "1.0",
"Tags": [],
"AutomatedSnapshotRetentionPeriod": 1,
"ClusterParameterGroups": [
{
"ParameterGroupName": "default.redshift-1.0",
"ParameterApplyStatus": "in-sync"
}
],
"DBName": "ccclusterdb",
"PreferredMaintenanceWindow": "fri:03:00-fri:03:30",
"Endpoint": {
"Port": 5439,
"Address": "cc-redshift-cluster.cmfpsgvyjhfo ... "
},
"IamRoles": [],
"AllowVersionUpgrade": true,
"ClusterCreateTime": "2017-01-12T17:44:12.654Z",
"ClusterSubnetGroupName": "default",
"ClusterSecurityGroups": [],
"ClusterIdentifier": "cc-redshift-cluster",
"ClusterNodes": [
{
"NodeRole": "SHARED",
"PrivateIPAddress": "172.31.43.56",
"PublicIPAddress": "52.3.14.122"
}
],
"AvailabilityZone": "us-east-1a",
"NodeType": "ds2.xlarge",
"Encrypted": false,
"ClusterRevisionNumber": "1106",
"ClusterStatus": "available"
}
]
}
03 Run create-cluster-snapshot command (OSX/Linux/UNIX) to create a manual snapshot of the existing Redshift database cluster:
aws redshift create-cluster-snapshot
--region us-east-1
--cluster-identifier cc-redshift-cluster
--snapshot-identifier cc-redshift-cluster-v2-snapshot
04 The command output should return the Redshift snapshot configuration metadata:
{
"Snapshot": {
"EstimatedSecondsToCompletion": -1,
"OwnerAccount": "123456789012",
"CurrentBackupRateInMegaBytesPerSecond": 0.0,
"ActualIncrementalBackupSizeInMegaBytes": -1.0,
"NumberOfNodes": 1,
"Status": "creating",
"VpcId": "vpc-d731653f",
"ClusterVersion": "1.0",
"MasterUsername": "ccclusterusr",
"TotalBackupSizeInMegaBytes": -1.0,
"DBName": "ccclusterdb",
"BackupProgressInMegaBytes": 0.0,
"ClusterCreateTime": "2017-01-12T17:44:12.654Z",
"EncryptedWithHSM": false,
"ClusterIdentifier": "cc-cluster",
"SnapshotCreateTime": "2017-08-18T18:15:49.041Z",
"AvailabilityZone": "us-east-1a",
"NodeType": "ds2.xlarge",
"Encrypted": false,
"ElapsedTimeInSeconds": 0,
"SnapshotType": "manual",
"Port": 5439,
"SnapshotIdentifier": "cc-redshift-cluster-v2-snapshot"
}
}
05 Run restore-from-cluster-snapshot command (OSX/Linux/UNIX) to create a new Amazon Redshift cluster from the snapshot created at step no. 3, using the configuration information returned at step no. 2 and a different number (e.g. 5640) for the database endpoint port (the chosen port number must be between 1115 and 65535):
aws redshift restore-from-cluster-snapshot
--region us-east-1
--cluster-identifier cc-redshift-cluster-v2
--snapshot-identifier cc-redshift-cluster-v2-snapshot
--node-type ds2.xlarge
--vpc-security-group-ids sg-541e2e7b
--cluster-subnet-group-name default
--availability-zone us-east-1a
--cluster-parameter-group-name default.redshift-1.0
--publicly-accessible
--port 5640
06 The command output should return the metadata of the new Redshift cluster:
{
"Cluster": {
"IamRoles": [],
"ClusterVersion": "1.0",
"NumberOfNodes": 1,
"VpcId": "vpc-d731653f",
"NodeType": "ds2.xlarge",
...
"ClusterStatus": "creating",
"ClusterIdentifier": "cc-redshift-cluster-v2",
"DBName": "ccclusterdb",
"PreferredMaintenanceWindow": "fri:03:00-fri:03:30",
"PendingModifiedValues": {}
}
}
07 Run describe-clusters command (OSX/Linux/UNIX) using the appropriate query filters to expose the new Redshift database cluster endpoint:
aws redshift describe-clusters
--region us-east-1
--cluster-identifier cc-redshift-cluster-v2
--query 'Clusters[*].Endpoint.Address'
08 The command output should return the requested endpoint URL:
[
"cc-redshift-cluster-v2.dyupsgvyjhfo.us-east-1.redshift.amazonaws.com"
]
09 As soon as the build process is complete, update your application configuration to point to the AWS Redshift database cluster endpoint address returned at step no. 8.
10 Once the Redshift cluster endpoint is changed within your application configuration, you can execute delete-cluster command (OSX/Linux/UNIX) to remove the source cluster from your AWS account:
aws redshift delete-cluster
--region us-east-1
--cluster-identifier cc-redshift-cluster
--final-cluster-snapshot-identifier cc-redshift-cluster-final-snapshot
11 The command output should return the metadata of the Redshift cluster selected for deletion:
{
"Cluster": {
"PubliclyAccessible": true,
"MasterUsername": "ccclusteruser",
"PendingModifiedValues": {},
"VpcId": "vpc-d731653f ",
"ClusterVersion": "1.0",
"AutomatedSnapshotRetentionPeriod": 1,
...
"ClusterSubnetGroupName": "default",
"ClusterSecurityGroups": [],
"ClusterIdentifier": "cc-redshift-cluster",
"AvailabilityZone": "us-east-1a",
"NodeType": "ds2.xlarge",
"Encrypted": false,
"ClusterStatus": "final-snapshot"
}
}
12 Repeat steps no. 1 – 11 to change the database endpoint port for other AWS Redshift clusters available in the current region.
13 Change the AWS region by updating the --region command parameter value and repeat steps no. 1 - 12 to perform the entire process for other regions.