Skip to content

Commit a8138f0

Browse files
committed
Fix Formation DynoSize assignment
1 parent 79ec64f commit a8138f0

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

heroku/resource_heroku_formation.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ type formation struct {
2828
Client *heroku.Service // Client to interact with the heroku API
2929
}
3030

31+
type dynoSize struct {
32+
ID string `json:"id" url:"id,key"` // unique identifier of the dyno size
33+
Name string `json:"name" url:"name,key"` // name of the dyno size
34+
} `json:"dyno_size" url:"dyno_size,key"` // dyno size
35+
3136
func resourceHerokuFormation() *schema.Resource {
3237
return &schema.Resource{
3338
Create: resourceHerokuFormationCreate,
@@ -110,7 +115,8 @@ func resourceHerokuFormationCreate(d *schema.ResourceData, meta interface{}) err
110115
if v, ok := d.GetOk("size"); ok {
111116
vs := v.(string)
112117
log.Printf("[DEBUG] Size: %s", vs)
113-
opts.DynoSize.Name = &vs
118+
ds := dynoSize{Name: &vs}
119+
opts.DynoSize = ds
114120
}
115121

116122
quantity := d.Get("quantity").(int)
@@ -139,7 +145,8 @@ func resourceHerokuFormationUpdate(d *schema.ResourceData, meta interface{}) err
139145
if d.HasChange("size") {
140146
v := d.Get("size").(string)
141147
log.Printf("[DEBUG] New Size: %s", v)
142-
opts.DynoSize.Name = &v
148+
ds := dynoSize{Name: &v}
149+
opts.DynoSize = ds
143150
}
144151

145152
if d.HasChange("quantity") {

0 commit comments

Comments
 (0)