diff --git a/aws/resource_aws_redshift_security_group.go b/aws/resource_aws_redshift_security_group.go index 5b960767e8e..57f4b2bfd59 100644 --- a/aws/resource_aws_redshift_security_group.go +++ b/aws/resource_aws_redshift_security_group.go @@ -135,21 +135,21 @@ func resourceAwsRedshiftSecurityGroupRead(d *schema.ResourceData, meta interface } for _, v := range sg.IPRanges { - rule := map[string]interface{}{"cidr": *v.CIDRIP} + rule := map[string]interface{}{"cidr": aws.StringValue(v.CIDRIP)} rules.Add(rule) } for _, g := range sg.EC2SecurityGroups { rule := map[string]interface{}{ - "security_group_name": *g.EC2SecurityGroupName, - "security_group_owner_id": *g.EC2SecurityGroupOwnerId, + "security_group_name": aws.StringValue(g.EC2SecurityGroupName), + "security_group_owner_id": aws.StringValue(g.EC2SecurityGroupOwnerId), } rules.Add(rule) } d.Set("ingress", rules) - d.Set("name", *sg.ClusterSecurityGroupName) - d.Set("description", *sg.Description) + d.Set("name", sg.ClusterSecurityGroupName) + d.Set("description", sg.Description) return nil } diff --git a/aws/resource_aws_redshift_security_group_test.go b/aws/resource_aws_redshift_security_group_test.go index 77dd7b95a5e..fedb7e97175 100644 --- a/aws/resource_aws_redshift_security_group_test.go +++ b/aws/resource_aws_redshift_security_group_test.go @@ -24,7 +24,7 @@ func TestAccAWSRedshiftSecurityGroup_basic(t *testing.T) { resourceName := "aws_redshift_security_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t); testAccEC2ClassicPreCheck(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckAWSRedshiftSecurityGroupDestroy, Steps: []resource.TestStep{ @@ -53,7 +53,7 @@ func TestAccAWSRedshiftSecurityGroup_ingressCidr(t *testing.T) { resourceName := "aws_redshift_security_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t); testAccEC2ClassicPreCheck(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckAWSRedshiftSecurityGroupDestroy, Steps: []resource.TestStep{ @@ -90,7 +90,7 @@ func TestAccAWSRedshiftSecurityGroup_updateIngressCidr(t *testing.T) { resourceName := "aws_redshift_security_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t); testAccEC2ClassicPreCheck(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckAWSRedshiftSecurityGroupDestroy, Steps: []resource.TestStep{ @@ -137,7 +137,7 @@ func TestAccAWSRedshiftSecurityGroup_ingressSecurityGroup(t *testing.T) { resourceName := "aws_redshift_security_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t); testAccEC2ClassicPreCheck(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckAWSRedshiftSecurityGroupDestroy, Steps: []resource.TestStep{ @@ -172,7 +172,7 @@ func TestAccAWSRedshiftSecurityGroup_updateIngressSecurityGroup(t *testing.T) { resourceName := "aws_redshift_security_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t); testAccEC2ClassicPreCheck(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckAWSRedshiftSecurityGroupDestroy, Steps: []resource.TestStep{