From fc7e9fcd53485e31e473f83ef0a0758059bb0443 Mon Sep 17 00:00:00 2001 From: Brandon Siegel Date: Tue, 8 Mar 2016 17:28:44 -0500 Subject: [PATCH] Ensure aws_rds_cluster can have storage_encrypted set to true --- .../aws/resource_aws_rds_cluster_test.go | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/builtin/providers/aws/resource_aws_rds_cluster_test.go b/builtin/providers/aws/resource_aws_rds_cluster_test.go index 24440e224..616861206 100644 --- a/builtin/providers/aws/resource_aws_rds_cluster_test.go +++ b/builtin/providers/aws/resource_aws_rds_cluster_test.go @@ -37,6 +37,29 @@ func TestAccAWSRDSCluster_basic(t *testing.T) { }) } +func TestAccAWSRDSCluster_encrypted(t *testing.T) { + var v rds.DBCluster + + ri := rand.New(rand.NewSource(time.Now().UnixNano())).Int() + encConfig := fmt.Sprintf(testAccAWSClusterConfig_encrypted, ri) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSClusterDestroy, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: encConfig, + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSClusterExists("aws_rds_cluster.default", &v), + resource.TestCheckResourceAttr( + "aws_rds_cluster.default", "storage_encrypted", "true"), + ), + }, + }, + }) +} + func TestAccAWSRDSCluster_backupsUpdate(t *testing.T) { var v rds.DBCluster @@ -152,6 +175,16 @@ resource "aws_rds_cluster" "default" { master_password = "mustbeeightcharaters" }` +var testAccAWSClusterConfig_encrypted = ` +resource "aws_rds_cluster" "default" { + cluster_identifier = "tf-aurora-cluster-%d" + availability_zones = ["us-west-2a","us-west-2b","us-west-2c"] + database_name = "mydb" + master_username = "foo" + master_password = "mustbeeightcharaters" + storage_encrypted = true +}` + var testAccAWSClusterConfig_backups = ` resource "aws_rds_cluster" "default" { cluster_identifier = "tf-aurora-cluster-%d"