Skip to content

Commit

Permalink
provider/heroku: Correct issue with setting CName in heroku_domain (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
catsby authored May 12, 2017
1 parent cb15a5d commit c159c48
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions builtin/providers/heroku/resource_heroku_domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ 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.Set("cname", do.CName)

log.Printf("[INFO] Domain ID: %s", d.Id())
return nil
Expand Down Expand Up @@ -81,7 +81,7 @@ func resourceHerokuDomainRead(d *schema.ResourceData, meta interface{}) error {
}

d.Set("hostname", do.Hostname)
d.Set("cname", fmt.Sprintf("%s.herokuapp.com", app))
d.Set("cname", do.CName)

return nil
}
3 changes: 1 addition & 2 deletions builtin/providers/heroku/resource_heroku_domain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ func TestAccHerokuDomain_Basic(t *testing.T) {
resource.TestCheckResourceAttr(
"heroku_domain.foobar", "app", appName),
resource.TestCheckResourceAttr(
"heroku_domain.foobar", "cname",
fmt.Sprintf("%s.herokuapp.com", appName)),
"heroku_domain.foobar", "cname", "terraform.example.com.herokudns.com"),
),
},
},
Expand Down

0 comments on commit c159c48

Please sign in to comment.