title: Create new security group for redshift and apply using Terraform
body: <p>I'm quite new to Terraform, and struggling with something.</p>
  <p>I'm playing around with Redshift for a personal project, and I want to update the inbound security rules for the default security group which is applied to Redshift when it's created.</p>
  <p>If I were doing it in AWS Console, I'd be adding a new inbound rule with <code>Type</code> being <code>All Traffic</code> and <code>Source</code> being <code>Anywhere -IPv4</code> which adds <code>0.0.0.0/0</code>.</p>
  <p>Below in <code>main.tf</code> I've tried to create a new security group and apply that to Redshift, but I get a <code>VPC-by-Default customers cannot use cluster security groups</code> error.</p>
  <p>What is it I'm doing wrong?</p>
  <pre><code>resource &quot;aws_redshift_cluster&quot; &quot;redshift&quot; {
    cluster_identifier = &quot;redshift-cluster-pipeline&quot;
    skip_final_snapshot = true terraform destroy
    master_username    = &quot;awsuser&quot;
    master_password    = var.db_password
    node_type          = &quot;dc2.large&quot;
    cluster_type       = &quot;single-node&quot;
    publicly_accessible = &quot;true&quot;
    iam_roles = [aws_iam_role.redshift_role.arn]
    cluster_security_groups = [aws_redshift_security_group.redshift-sg.name]
  }
  
  resource &quot;aws_redshift_security_group&quot; &quot;redshift-sg&quot; {
    name = &quot;redshift-sg&quot;
    ingress {
      cidr = &quot;0.0.0.0/0&quot;
      }
  </code></pre>