Skip to content

Commit

Permalink
provider/aws: Fixes issue where an update for an `aws_elastic_beansta…
Browse files Browse the repository at this point in the history
…lk_environment ` resource would ignore the `wait_for_ready_timeout` option.
  • Loading branch information
dharrisio authored and stack72 committed Apr 26, 2016
1 parent ac10a79 commit 635fced
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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
}
Expand All @@ -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,
}
Expand Down

0 comments on commit 635fced

Please sign in to comment.