providers/heroku: set all the things
This commit is contained in:
parent
e4a2cb216c
commit
3e6263332d
|
@ -118,17 +118,17 @@ func resourceHerokuAppCreate(d *schema.ResourceData, meta interface{}) error {
|
||||||
// Build up our creation options
|
// Build up our creation options
|
||||||
opts := heroku.AppCreateOpts{}
|
opts := heroku.AppCreateOpts{}
|
||||||
|
|
||||||
if v := d.Get("name"); v != nil {
|
if v, ok := d.GetOk("name"); ok {
|
||||||
vs := v.(string)
|
vs := v.(string)
|
||||||
log.Printf("[DEBUG] App name: %s", vs)
|
log.Printf("[DEBUG] App name: %s", vs)
|
||||||
opts.Name = &vs
|
opts.Name = &vs
|
||||||
}
|
}
|
||||||
if v := d.Get("region"); v != nil {
|
if v, ok := d.GetOk("region"); ok {
|
||||||
vs := v.(string)
|
vs := v.(string)
|
||||||
log.Printf("[DEBUG] App region: %s", vs)
|
log.Printf("[DEBUG] App region: %s", vs)
|
||||||
opts.Region = &vs
|
opts.Region = &vs
|
||||||
}
|
}
|
||||||
if v := d.Get("stack"); v != nil {
|
if v, ok := d.GetOk("stack"); ok {
|
||||||
vs := v.(string)
|
vs := v.(string)
|
||||||
log.Printf("[DEBUG] App stack: %s", vs)
|
log.Printf("[DEBUG] App stack: %s", vs)
|
||||||
opts.Stack = &vs
|
opts.Stack = &vs
|
||||||
|
@ -143,7 +143,7 @@ func resourceHerokuAppCreate(d *schema.ResourceData, meta interface{}) error {
|
||||||
d.SetId(a.Name)
|
d.SetId(a.Name)
|
||||||
log.Printf("[INFO] App ID: %s", d.Id())
|
log.Printf("[INFO] App ID: %s", d.Id())
|
||||||
|
|
||||||
if v := d.Get("config_vars"); v != nil {
|
if v, ok := d.GetOk("config_vars"); ok {
|
||||||
err = update_config_vars(d.Id(), client, nil, v.([]interface{}))
|
err = update_config_vars(d.Id(), client, nil, v.([]interface{}))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -157,22 +157,22 @@ func resourceHerokuOrgAppCreate(d *schema.ResourceData, meta interface{}) error
|
||||||
client := meta.(*heroku.Service)
|
client := meta.(*heroku.Service)
|
||||||
// Build up our creation options
|
// Build up our creation options
|
||||||
opts := heroku.OrganizationAppCreateOpts{}
|
opts := heroku.OrganizationAppCreateOpts{}
|
||||||
if v := d.Get("organization"); v != nil {
|
if v, ok := d.GetOk("organization"); ok {
|
||||||
vs := v.(string)
|
vs := v.(string)
|
||||||
log.Printf("[DEBUG] App name: %s", vs)
|
log.Printf("[DEBUG] App name: %s", vs)
|
||||||
opts.Organization = &vs
|
opts.Organization = &vs
|
||||||
}
|
}
|
||||||
if v := d.Get("name"); v != nil {
|
if v, ok := d.GetOk("name"); ok {
|
||||||
vs := v.(string)
|
vs := v.(string)
|
||||||
log.Printf("[DEBUG] App name: %s", vs)
|
log.Printf("[DEBUG] App name: %s", vs)
|
||||||
opts.Name = &vs
|
opts.Name = &vs
|
||||||
}
|
}
|
||||||
if v := d.Get("region"); v != nil {
|
if v, ok := d.GetOk("region"); ok {
|
||||||
vs := v.(string)
|
vs := v.(string)
|
||||||
log.Printf("[DEBUG] App region: %s", vs)
|
log.Printf("[DEBUG] App region: %s", vs)
|
||||||
opts.Region = &vs
|
opts.Region = &vs
|
||||||
}
|
}
|
||||||
if v := d.Get("stack"); v != nil {
|
if v, ok := d.GetOk("stack"); ok {
|
||||||
vs := v.(string)
|
vs := v.(string)
|
||||||
log.Printf("[DEBUG] App stack: %s", vs)
|
log.Printf("[DEBUG] App stack: %s", vs)
|
||||||
opts.Stack = &vs
|
opts.Stack = &vs
|
||||||
|
@ -187,7 +187,7 @@ func resourceHerokuOrgAppCreate(d *schema.ResourceData, meta interface{}) error
|
||||||
d.SetId(a.Name)
|
d.SetId(a.Name)
|
||||||
log.Printf("[INFO] App ID: %s", d.Id())
|
log.Printf("[INFO] App ID: %s", d.Id())
|
||||||
|
|
||||||
if v := d.Get("config_vars"); v != nil {
|
if v, ok := d.GetOk("config_vars"); ok {
|
||||||
err = update_config_vars(d.Id(), client, nil, v.([]interface{}))
|
err = update_config_vars(d.Id(), client, nil, v.([]interface{}))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in New Issue