diff --git a/builtin/providers/aws/resource_aws_rds_cluster.go b/builtin/providers/aws/resource_aws_rds_cluster.go index 7b134dade..1cac71a91 100644 --- a/builtin/providers/aws/resource_aws_rds_cluster.go +++ b/builtin/providers/aws/resource_aws_rds_cluster.go @@ -24,6 +24,12 @@ func resourceAwsRDSCluster() *schema.Resource { State: resourceAwsRdsClusterImport, }, + Timeouts: &schema.ResourceTimeout{ + Create: schema.DefaultTimeout(120 * time.Minute), + Update: schema.DefaultTimeout(120 * time.Minute), + Delete: schema.DefaultTimeout(120 * time.Minute), + }, + Schema: map[string]*schema.Schema{ "availability_zones": { @@ -305,9 +311,9 @@ func resourceAwsRDSClusterCreate(d *schema.ResourceData, meta interface{}) error Pending: []string{"creating", "backing-up", "modifying"}, Target: []string{"available"}, Refresh: resourceAwsRDSClusterStateRefreshFunc(d, meta), - Timeout: 120 * time.Minute, - MinTimeout: 3 * time.Second, - Delay: 30 * time.Second, // Wait 30 secs before starting + Timeout: d.Timeout(schema.TimeoutCreate), + MinTimeout: 10 * time.Second, + Delay: 30 * time.Second, } // Wait, catching any errors @@ -458,8 +464,9 @@ func resourceAwsRDSClusterCreate(d *schema.ResourceData, meta interface{}) error Pending: []string{"creating", "backing-up", "modifying"}, Target: []string{"available"}, Refresh: resourceAwsRDSClusterStateRefreshFunc(d, meta), - Timeout: 120 * time.Minute, - MinTimeout: 3 * time.Second, + Timeout: d.Timeout(schema.TimeoutCreate), + MinTimeout: 10 * time.Second, + Delay: 30 * time.Second, } // Wait, catching any errors @@ -660,8 +667,9 @@ func resourceAwsRDSClusterDelete(d *schema.ResourceData, meta interface{}) error Pending: []string{"available", "deleting", "backing-up", "modifying"}, Target: []string{"destroyed"}, Refresh: resourceAwsRDSClusterStateRefreshFunc(d, meta), - Timeout: 15 * time.Minute, - MinTimeout: 3 * time.Second, + Timeout: d.Timeout(schema.TimeoutDelete), + MinTimeout: 10 * time.Second, + Delay: 30 * time.Second, } // Wait, catching any errors