Skip to content

Commit

Permalink
providers/aws: wait for LC to exist [GH-302]
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellh committed Oct 11, 2014
1 parent 129771d commit bd0cf94
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ BUG FIXES:
count of instances.
* providers/aws: Terraform can handle ELBs deleted manually. [GH-304]
* providers/aws: Report errors properly if RDS fails to delete. [GH-310]
* providers/aws: Wait for launch configuration to exist after creation
(AWS eventual consistency) [GH-302]

## 0.2.2 (September 9, 2014)

Expand Down
8 changes: 7 additions & 1 deletion builtin/providers/aws/resource_aws_launch_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ import (
"encoding/hex"
"fmt"
"log"
"time"

"github.com/hashicorp/terraform/helper/hashcode"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/helper/schema"
"github.com/mitchellh/goamz/autoscaling"
)
Expand Down Expand Up @@ -103,7 +105,11 @@ func resourceAwsLaunchConfigurationCreate(d *schema.ResourceData, meta interface
d.SetId(d.Get("name").(string))
log.Printf("[INFO] launch configuration ID: %s", d.Id())

return resourceAwsLaunchConfigurationRead(d, meta)
// We put a Retry here since sometimes eventual consistency bites
// us and we need to retry a few times to get the LC to load properly
return resource.Retry(30 * time.Second, func() error {
return resourceAwsLaunchConfigurationRead(d, meta)
})
}

func resourceAwsLaunchConfigurationDelete(d *schema.ResourceData, meta interface{}) error {
Expand Down

0 comments on commit bd0cf94

Please sign in to comment.