From accc477984c2ab8475b9dd9438c9e4248eae057a Mon Sep 17 00:00:00 2001 From: Jack Pearkes Date: Wed, 23 Jul 2014 15:55:01 -0400 Subject: [PATCH] providers/heroku: add cname to domain --- builtin/providers/heroku/resource_heroku_domain.go | 2 ++ builtin/providers/heroku/resource_heroku_domain_test.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/builtin/providers/heroku/resource_heroku_domain.go b/builtin/providers/heroku/resource_heroku_domain.go index 1dcb3cc2c..df5c87e33 100644 --- a/builtin/providers/heroku/resource_heroku_domain.go +++ b/builtin/providers/heroku/resource_heroku_domain.go @@ -34,6 +34,7 @@ func resource_heroku_domain_create( rs.ID = do.Id rs.Attributes["hostname"] = do.Hostname + rs.Attributes["cname"] = fmt.Sprintf("%s.herokuapp.com", app) log.Printf("[INFO] Domain ID: %s", rs.ID) @@ -80,6 +81,7 @@ func resource_heroku_domain_refresh( } s.Attributes["hostname"] = domain.Hostname + s.Attributes["cname"] = fmt.Sprintf("%s.herokuapp.com", s.Attributes["app"]) return s, nil } diff --git a/builtin/providers/heroku/resource_heroku_domain_test.go b/builtin/providers/heroku/resource_heroku_domain_test.go index 87e2439de..315881690 100644 --- a/builtin/providers/heroku/resource_heroku_domain_test.go +++ b/builtin/providers/heroku/resource_heroku_domain_test.go @@ -26,6 +26,8 @@ func TestAccHerokuDomain_Basic(t *testing.T) { "heroku_domain.foobar", "hostname", "terraform.example.com"), resource.TestCheckResourceAttr( "heroku_domain.foobar", "app", "terraform-test-app"), + resource.TestCheckResourceAttr( + "heroku_domain.foobar", "cname", "terraform-test-app.herokuapp.com"), ), }, },