@@ -20,6 +20,27 @@ func TestAccAWSRDSCluster_basic(t *testing.T) {
2020 ri := rand .New (rand .NewSource (time .Now ().UnixNano ())).Int ()
2121 config := fmt .Sprintf (testAccAWSClusterConfig , ri )
2222
23+ resource .Test (t , resource.TestCase {
24+ PreCheck : func () { testAccPreCheck (t ) },
25+ Providers : testAccProviders ,
26+ CheckDestroy : testAccCheckAWSClusterDestroy ,
27+ Steps : []resource.TestStep {
28+ resource.TestStep {
29+ Config : config ,
30+ Check : resource .ComposeTestCheckFunc (
31+ testAccCheckAWSClusterExists ("aws_rds_cluster.default" , & v ),
32+ ),
33+ },
34+ },
35+ })
36+ }
37+
38+ func TestAccAWSRDSCluster_backups (t * testing.T ) {
39+ var v rds.DBCluster
40+
41+ ri := rand .New (rand .NewSource (time .Now ().UnixNano ())).Int ()
42+ config := fmt .Sprintf (testAccAWSClusterConfig_backups , ri )
43+
2344 resource .Test (t , resource.TestCase {
2445 PreCheck : func () { testAccPreCheck (t ) },
2546 Providers : testAccProviders ,
@@ -41,12 +62,12 @@ func TestAccAWSRDSCluster_basic(t *testing.T) {
4162 })
4263}
4364
44- func TestAccAWSRDSCluster_update (t * testing.T ) {
65+ func TestAccAWSRDSCluster_backupsUpdate (t * testing.T ) {
4566 var v rds.DBCluster
4667
4768 ri := rand .New (rand .NewSource (time .Now ().UnixNano ())).Int ()
48- preConfig := fmt .Sprintf (testAccAWSClusterConfig , ri )
49- postConfig := fmt .Sprintf (testAccAWSClusterConfig_update , ri )
69+ preConfig := fmt .Sprintf (testAccAWSClusterConfig_backups , ri )
70+ postConfig := fmt .Sprintf (testAccAWSClusterConfig_backupsUpdate , ri )
5071
5172 resource .Test (t , resource.TestCase {
5273 PreCheck : func () { testAccPreCheck (t ) },
@@ -147,8 +168,16 @@ func testAccCheckAWSClusterExists(n string, v *rds.DBCluster) resource.TestCheck
147168 }
148169}
149170
150- // Add some random to the name, to avoid collision
151171var testAccAWSClusterConfig = `
172+ resource "aws_rds_cluster" "default" {
173+ cluster_identifier = "tf-aurora-cluster-%d"
174+ availability_zones = ["us-west-2a","us-west-2b","us-west-2c"]
175+ database_name = "mydb"
176+ master_username = "foo"
177+ master_password = "mustbeeightcharaters"
178+ }`
179+
180+ var testAccAWSClusterConfig_backups = `
152181resource "aws_rds_cluster" "default" {
153182 cluster_identifier = "tf-aurora-cluster-%d"
154183 availability_zones = ["us-west-2a","us-west-2b","us-west-2c"]
@@ -160,8 +189,7 @@ resource "aws_rds_cluster" "default" {
160189 preferred_maintenance_window = "tue:04:00-tue:04:30"
161190}`
162191
163- // Add some random to the name, to avoid collision
164- var testAccAWSClusterConfig_update = `
192+ var testAccAWSClusterConfig_backupsUpdate = `
165193resource "aws_rds_cluster" "default" {
166194 cluster_identifier = "tf-aurora-cluster-%d"
167195 availability_zones = ["us-west-2a","us-west-2b","us-west-2c"]
0 commit comments