Triage and Remediation
- Remediation
Remediation
Using Console
Using Console
For Redshift, the equivalent control is “Redshift clusters must be launched in a VPC (not EC2-Classic) and associated only with approved VPCs/subnets.”
Redshift now launches only into VPC by default in most regions, but older clusters might still be outside or in an incorrect VPC/network setup. You can’t “move” an existing Redshift cluster to a different network; you must recreate it in the desired VPC.Below are console-based steps, assuming two scenarios:
By enforcing that all Redshift clusters are restored/created only in approved VPCs and subnet groups, you satisfy the “clusters must be in VPC” requirement for Redshift using the AWS console.
Redshift now launches only into VPC by default in most regions, but older clusters might still be outside or in an incorrect VPC/network setup. You can’t “move” an existing Redshift cluster to a different network; you must recreate it in the desired VPC.Below are console-based steps, assuming two scenarios:
1. Ensure new Redshift clusters are in a VPC
A. Create or verify a VPC and subnets
- In the AWS Management Console, go to VPC.
- If you already have a compliant VPC, note:
- VPC ID
- Subnet IDs (in at least two AZs if you want multi-AZ style resilience)
- Route tables, and whether they allow required connectivity.
- If you need a new VPC:
- Click Your VPCs > Create VPC.
- Choose VPC only or VPC and more, give it a name and CIDR (e.g.,
10.0.0.0/16). - Create at least 2 private subnets for Redshift:
- Go to Subnets > Create subnet, select your VPC and define CIDR blocks (e.g.,
10.0.1.0/24,10.0.2.0/24).
- Go to Subnets > Create subnet, select your VPC and define CIDR blocks (e.g.,
- Set up NAT gateway / routing if the cluster needs outbound internet access.
- Optionally create VPC endpoints (for S3 etc.) if you want private access.
B. Create a Redshift subnet group
- Go to Amazon Redshift console.
- In the left panel, choose Configurations > Subnet groups.
- Click Create cluster subnet group.
- Provide:
- Name and Description
- VPC: select the VPC you prepared.
- Subnets: add the private subnets for Redshift.
- Click Create cluster subnet group.
C. Create or configure a security group for Redshift
- Go to VPC console → Security groups.
- Create security group:
- Select the same VPC.
- Add an inbound rule for Redshift:
- Type: Redshift (TCP 5439) or a custom TCP rule for the cluster port.
- Source: a specific CIDR or security group (e.g., application servers’ SG), not
0.0.0.0/0unless justified.
- Save the security group ID for use when creating the cluster.
D. Create the Redshift cluster in the VPC
- Go to Amazon Redshift console.
- Click Create cluster.
- Under Cluster configuration, set usual options (identifier, node type, etc.).
- Under Network and security:
- VPC: select your target VPC.
- Subnet group: select the subnet group you created.
- Publicly accessible:
- Usually No (private cluster); set Yes only if absolutely necessary.
- VPC security groups: select the security group you configured.
- Finish the wizard and create the cluster.
2. Remediate an existing Redshift cluster not in the correct VPC
You cannot directly move a Redshift cluster from EC2-Classic or another VPC. You must snapshot and recreate.A. Take a snapshot of the existing cluster
- Go to Amazon Redshift console → Clusters.
- Select the non-compliant cluster.
- Choose Actions > Create snapshot.
- Enter a name and confirm.
- Wait until the snapshot status is available.
B. Restore the snapshot into a VPC
- In Redshift console, go to Snapshots.
- Select the snapshot you just created.
- Click Actions > Restore from snapshot (or Restore snapshot).
- In the restore wizard:
- Cluster identifier: new name (e.g.,
mycluster-vpc). - Under Network and security:
- VPC: select the compliant VPC.
- Subnet group: choose the subnet group you created.
- Publicly accessible: typically No.
- VPC security group: choose the secure SG.
- Adjust port if needed (default 5439).
- Cluster identifier: new name (e.g.,
- Complete restoration and wait for the new cluster to become available.
C. Update clients / applications to use the new cluster
- In the new cluster details, copy the Endpoint.
- Update:
- Application configuration / connection strings.
- ETL jobs, BI tools, Lambda functions, etc., to point to the new endpoint.
- Validate connectivity and data correctness.
D. Decommission the old non-compliant cluster
- Once fully validated, go to Clusters.
- Select the old cluster.
- Actions > Delete:
- Optionally keep a final snapshot if you want.
- Confirm deletion.
By enforcing that all Redshift clusters are restored/created only in approved VPCs and subnet groups, you satisfy the “clusters must be in VPC” requirement for Redshift using the AWS console.
Using CLI
Using CLI
For Amazon Redshift, the equivalent of “EMR clusters should be in a VPC” is “Redshift clusters must be launched in a VPC (not EC2-Classic).”
You can’t move an existing non‑VPC Redshift cluster into a VPC; instead you snapshot it and restore into a VPC.Below are AWS CLI–based steps.
If this returns your cluster(s), they are not in a VPC and must be migrated.
Pick a VPC ID (e.g., Pick 2+ subnets in different AZs for production use.
Open Redshift port 5439 only to needed sources (example: office IP):
Wait until snapshot is ready:
Optionally adjust public accessibility:Wait for the cluster to become
Update all applications to use this new endpoint.
(Or omit
After these steps, your Redshift cluster runs inside a VPC and satisfies the “must be in VPC” requirement.
You can’t move an existing non‑VPC Redshift cluster into a VPC; instead you snapshot it and restore into a VPC.Below are AWS CLI–based steps.
1. Identify Redshift clusters not in a VPC
2. Choose or create a VPC and subnets
List VPCs:vpc-0123456789abcdef0).List subnets in that VPC:3. Create a Redshift subnet group in that VPC
4. Create / choose security groups for Redshift
Create a security group in the same VPC:5. Snapshot the existing non‑VPC cluster
6. Restore the cluster into the VPC
Restore from snapshot specifying the subnet group and security group(s):available:7. Update applications and clients
Get new endpoint:8. Decommission the old non‑VPC cluster
Once you’ve confirmed everything works:--skip-final-cluster-snapshot and provide --final-cluster-snapshot-identifier if you want another final snapshot.)After these steps, your Redshift cluster runs inside a VPC and satisfies the “must be in VPC” requirement.
Using Python
Using Python
For Redshift, “cluster in VPC” effectively means: each Redshift cluster must be associated with a VPC subnet group (i.e., have a non‑null
You’ll also need:
VpcId and ClusterSubnetGroupName). Old “EC2-Classic” style clusters are the issue.Below is how to (1) detect non‑VPC Redshift clusters and (2) migrate them into a VPC using Python/boto3.1. Prereqs
- A target VPC ID (e.g.
vpc-1234567890abcdef0) - At least two private subnets in that VPC (for multi‑AZ best practice), e.g.:
subnet-aaa...subnet-bbb...
- A security group for Redshift, e.g.
sg-1234...(with appropriate inbound rules from your app/BI tools and outbound allowed)
2. Detect Redshift clusters not in a VPC
3. Create / verify a Redshift subnet group for your VPC
4. Migrate each non‑VPC cluster into the VPC
You can’t “flip” an existing non‑VPC Redshift cluster into a VPC in‑place. The safe pattern:- Take a snapshot of the existing cluster.
- Restore a new cluster from that snapshot into the VPC subnet group, with a VPC security group.
- Cut over DNS / application connections to the new endpoint.
- Delete the old non‑VPC cluster and old snapshot (once validated).
4.1 Snapshot the original cluster
4.2 Restore a new VPC-based cluster from the snapshot
You’ll map the old cluster to a new ID (e.g., append-vpc), in a VPC subnet group and security group.5. Cutover and clean up
- Update application connection strings to use the new cluster’s endpoint (hostname + port + DB name).
- Validate queries / workloads on the new VPC cluster.
- When fully satisfied, delete the old cluster and snapshot.
6. Summary of remediation
- Detect Redshift clusters with no
VpcId(non‑VPC). - Create a Redshift subnet group for your target VPC.
- For each non‑VPC cluster:
- Take a manual snapshot.
- Restore a new cluster from that snapshot in the VPC (subnet group + VPC SG).
- Switch clients to the new endpoint.
- Delete old non‑VPC cluster and its snapshot once verified.
Using Terraform
Using Terraform
cluster_subnet_group_name / vpc_security_group_ids) forces replacement of the cluster; this can cause downtime and potential data loss if not migrated carefully.For verification, terraform plan should show the Redshift cluster either being created with cluster_subnet_group_name and vpc_security_group_ids set, or (for an existing non‑VPC cluster) a -/+ replacement where the new resource includes those VPC fields.
