diff --git a/aws/resource_aws_docdb_cluster_instance.go b/aws/resource_aws_docdb_cluster_instance.go index 997bbed69c7..bd4133eb883 100644 --- a/aws/resource_aws_docdb_cluster_instance.go +++ b/aws/resource_aws_docdb_cluster_instance.go @@ -213,6 +213,9 @@ func resourceAwsDocDBClusterInstanceCreate(d *schema.ResourceData, meta interfac } return nil }) + if isResourceTimeoutError(err) { + resp, err = conn.CreateDBInstance(createOpts) + } if err != nil { return fmt.Errorf("error creating DocDB Instance: %s", err) } @@ -356,6 +359,9 @@ func resourceAwsDocDBClusterInstanceUpdate(d *schema.ResourceData, meta interfac } return nil }) + if isResourceTimeoutError(err) { + _, err = conn.ModifyDBInstance(req) + } if err != nil { return fmt.Errorf("Error modifying DB Instance %s: %s", d.Id(), err) } diff --git a/aws/resource_aws_docdb_cluster_parameter_group.go b/aws/resource_aws_docdb_cluster_parameter_group.go index 2d1fce488ba..396a2d5eeaf 100644 --- a/aws/resource_aws_docdb_cluster_parameter_group.go +++ b/aws/resource_aws_docdb_cluster_parameter_group.go @@ -266,7 +266,7 @@ func waitForDocDBClusterParameterGroupDeletion(conn *docdb.DocDB, name string) e DBClusterParameterGroupName: aws.String(name), } - return resource.Retry(10*time.Minute, func() *resource.RetryError { + err := resource.Retry(10*time.Minute, func() *resource.RetryError { _, err := conn.DescribeDBClusterParameterGroups(params) if isAWSErr(err, docdb.ErrCodeDBParameterGroupNotFoundFault, "") { @@ -279,4 +279,14 @@ func waitForDocDBClusterParameterGroupDeletion(conn *docdb.DocDB, name string) e return resource.RetryableError(fmt.Errorf("DocDB Parameter Group (%s) still exists", name)) }) + if isResourceTimeoutError(err) { + _, err = conn.DescribeDBClusterParameterGroups(params) + if isAWSErr(err, docdb.ErrCodeDBParameterGroupNotFoundFault, "") { + return nil + } + } + if err != nil { + return fmt.Errorf("Error deleting DocDB cluster parameter group: %s", err) + } + return nil } diff --git a/aws/resource_aws_docdb_subnet_group.go b/aws/resource_aws_docdb_subnet_group.go index 22b99fc83d4..f60e2da0d16 100644 --- a/aws/resource_aws_docdb_subnet_group.go +++ b/aws/resource_aws_docdb_subnet_group.go @@ -203,7 +203,7 @@ func waitForDocDBSubnetGroupDeletion(conn *docdb.DocDB, name string) error { DBSubnetGroupName: aws.String(name), } - return resource.Retry(10*time.Minute, func() *resource.RetryError { + err := resource.Retry(10*time.Minute, func() *resource.RetryError { _, err := conn.DescribeDBSubnetGroups(params) if isAWSErr(err, docdb.ErrCodeDBSubnetGroupNotFoundFault, "") { @@ -216,4 +216,14 @@ func waitForDocDBSubnetGroupDeletion(conn *docdb.DocDB, name string) error { return resource.RetryableError(fmt.Errorf("DocDB Subnet Group (%s) still exists", name)) }) + if isResourceTimeoutError(err) { + _, err = conn.DescribeDBSubnetGroups(params) + if isAWSErr(err, docdb.ErrCodeDBSubnetGroupNotFoundFault, "") { + return nil + } + } + if err != nil { + return fmt.Errorf("Error deleting DocDB subnet group: %s", err) + } + return nil }