providers/heroku: domain/drain have dep on app

This commit is contained in:
Mitchell Hashimoto 2014-08-19 10:16:47 -07:00
parent 2a6b83591a
commit 9a0c0ea985
3 changed files with 9 additions and 0 deletions

View File

@ -14,6 +14,7 @@ BUG FIXES:
* core: Variables are validated to not contain interpolations. [GH-180]
* providers/heroku: If you delete the `config_vars` block, config vars
are properly nuked.
* providers/heroku: Domains and drains are deleted before the app.
PLUGIN CHANGES:

View File

@ -6,6 +6,7 @@ import (
"github.com/bgentry/heroku-go"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/terraform"
)
func resourceHerokuDomain() *schema.Resource {
@ -51,6 +52,9 @@ func resourceHerokuDomainCreate(d *schema.ResourceData, meta interface{}) error
d.SetId(do.Id)
d.Set("hostname", do.Hostname)
d.Set("cname", fmt.Sprintf("%s.herokuapp.com", app))
d.SetDependencies([]terraform.ResourceDependency{
terraform.ResourceDependency{ID: app},
})
log.Printf("[INFO] Domain ID: %s", d.Id())
return nil

View File

@ -6,6 +6,7 @@ import (
"github.com/bgentry/heroku-go"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/terraform"
)
func resourceHerokuDrain() *schema.Resource {
@ -51,6 +52,9 @@ func resourceHerokuDrainCreate(d *schema.ResourceData, meta interface{}) error {
d.SetId(dr.Id)
d.Set("url", dr.URL)
d.Set("token", dr.Token)
d.SetDependencies([]terraform.ResourceDependency{
terraform.ResourceDependency{ID: app},
})
log.Printf("[INFO] Drain ID: %s", d.Id())
return nil