provider/heroku: Correct issue with setting CName in heroku_domain (#14443)

This commit is contained in:
Clint 2017-05-12 15:13:21 -05:00 committed by GitHub
parent cb15a5d0a7
commit c159c48f5e
2 changed files with 3 additions and 4 deletions

View File

@ -51,7 +51,7 @@ func resourceHerokuDomainCreate(d *schema.ResourceData, meta interface{}) error
d.SetId(do.ID) d.SetId(do.ID)
d.Set("hostname", do.Hostname) 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()) log.Printf("[INFO] Domain ID: %s", d.Id())
return nil return nil
@ -81,7 +81,7 @@ func resourceHerokuDomainRead(d *schema.ResourceData, meta interface{}) error {
} }
d.Set("hostname", do.Hostname) d.Set("hostname", do.Hostname)
d.Set("cname", fmt.Sprintf("%s.herokuapp.com", app)) d.Set("cname", do.CName)
return nil return nil
} }

View File

@ -30,8 +30,7 @@ func TestAccHerokuDomain_Basic(t *testing.T) {
resource.TestCheckResourceAttr( resource.TestCheckResourceAttr(
"heroku_domain.foobar", "app", appName), "heroku_domain.foobar", "app", appName),
resource.TestCheckResourceAttr( resource.TestCheckResourceAttr(
"heroku_domain.foobar", "cname", "heroku_domain.foobar", "cname", "terraform.example.com.herokudns.com"),
fmt.Sprintf("%s.herokuapp.com", appName)),
), ),
}, },
}, },