provider/aws: Fixes issue where an update for an `aws_elastic_beanstalk_environment ` resource would ignore the `wait_for_ready_timeout` option.

This commit is contained in:
David Harris 2016-04-26 15:05:20 -06:00 committed by Paul Stack
parent ac10a7979d
commit 635fced8b4
1 changed files with 6 additions and 2 deletions

View File

@ -257,6 +257,10 @@ func resourceAwsElasticBeanstalkEnvironmentUpdate(d *schema.ResourceData, meta i
conn := meta.(*AWSClient).elasticbeanstalkconn
envId := d.Id()
waitForReadyTimeOut, err := time.ParseDuration(d.Get("wait_for_ready_timeout").(string))
if err != nil {
return err
}
updateOpts := elasticbeanstalk.UpdateEnvironmentInput{
EnvironmentId: aws.String(envId),
@ -290,7 +294,7 @@ func resourceAwsElasticBeanstalkEnvironmentUpdate(d *schema.ResourceData, meta i
}
log.Printf("[DEBUG] Elastic Beanstalk Environment update opts: %s", updateOpts)
_, err := conn.UpdateEnvironment(&updateOpts)
_, err = conn.UpdateEnvironment(&updateOpts)
if err != nil {
return err
}
@ -299,7 +303,7 @@ func resourceAwsElasticBeanstalkEnvironmentUpdate(d *schema.ResourceData, meta i
Pending: []string{"Launching", "Updating"},
Target: []string{"Ready"},
Refresh: environmentStateRefreshFunc(conn, d.Id()),
Timeout: 10 * time.Minute,
Timeout: waitForReadyTimeOut,
Delay: 10 * time.Second,
MinTimeout: 3 * time.Second,
}