Merge pull request #5515 from hashicorp/b-aws-acc-test-updates

provider/aws: Retry DB Creation on IAM propigation error
This commit is contained in:
Clint 2016-03-09 15:08:13 -06:00
commit d14920adaf
2 changed files with 13 additions and 2 deletions

View File

@ -534,7 +534,18 @@ func resourceAwsDbInstanceCreate(d *schema.ResourceData, meta interface{}) error
log.Printf("[DEBUG] DB Instance create configuration: %#v", opts) log.Printf("[DEBUG] DB Instance create configuration: %#v", opts)
var err error var err error
_, err = conn.CreateDBInstance(&opts) err = resource.Retry(5*time.Minute, func() error {
_, err = conn.CreateDBInstance(&opts)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
if awsErr.Code() == "InvalidParameterValue" && strings.Contains(awsErr.Message(), "ENHANCED_MONITORING") {
return awsErr
}
}
return resource.RetryError{Err: err}
}
return nil
})
if err != nil { if err != nil {
return fmt.Errorf("Error creating DB Instance: %s", err) return fmt.Errorf("Error creating DB Instance: %s", err)
} }

View File

@ -514,7 +514,7 @@ resource "aws_db_instance" "enhanced_monitoring" {
allocated_storage = 5 allocated_storage = 5
engine = "mysql" engine = "mysql"
engine_version = "5.6.21" engine_version = "5.6.21"
instance_class = "db.t2.small" instance_class = "db.m3.medium"
name = "baz" name = "baz"
password = "barbarbarbar" password = "barbarbarbar"
username = "foo" username = "foo"