@@ -74,6 +74,11 @@ func resourceHerokuApp() *schema.Resource {
7474 },
7575 },
7676
77+ "all_config_vars" : & schema.Schema {
78+ Type : schema .TypeMap ,
79+ Computed : true ,
80+ },
81+
7782 "git_url" : & schema.Schema {
7883 Type : schema .TypeString ,
7984 Computed : true ,
@@ -140,16 +145,18 @@ func resourceHerokuAppRead(d *schema.ResourceData, meta interface{}) error {
140145 return err
141146 }
142147
143- // Only get the config vars that we care about
148+ // Only set the config_vars that we have set in the configuration.
149+ // The "all_config_vars" field has all of them.
150+ configVars := make (map [string ]string )
144151 care := make (map [string ]struct {})
145152 for _ , v := range d .Get ("config_vars" ).([]interface {}) {
146153 for k , _ := range v .(map [string ]interface {}) {
147154 care [k ] = struct {}{}
148155 }
149156 }
150- for k , _ := range app .Vars {
157+ for k , v := range app .Vars {
151158 if _ , ok := care [k ]; ! ok {
152- delete ( app . Vars , k )
159+ configVars [ k ] = v
153160 }
154161 }
155162
@@ -158,7 +165,8 @@ func resourceHerokuAppRead(d *schema.ResourceData, meta interface{}) error {
158165 d .Set ("region" , app .App .Region .Name )
159166 d .Set ("git_url" , app .App .GitURL )
160167 d .Set ("web_url" , app .App .WebURL )
161- d .Set ("config_vars" , []map [string ]string {app .Vars })
168+ d .Set ("config_vars" , []map [string ]string {configVars })
169+ d .Set ("all_config_vars" , app .Vars )
162170
163171 // We know that the hostname on heroku will be the name+herokuapp.com
164172 // You need this to do things like create DNS CNAME records
0 commit comments