mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-09 23:54:17 -06:00
1b6f37b6eb
The default stack changed from ‘cedar’ to ‘cedar-14’, so updated the acceptance tests to reflect this. Updating the schema makes testing easier and gives you a way to configure the provider using env variables. It also makes the provider more inline following the TF 0.2 approach.
30 lines
517 B
Go
30 lines
517 B
Go
package heroku
|
|
|
|
import (
|
|
"log"
|
|
"net/http"
|
|
|
|
"github.com/cyberdelia/heroku-go/v3"
|
|
)
|
|
|
|
type Config struct {
|
|
Email string
|
|
APIKey string
|
|
}
|
|
|
|
// Client() returns a new Service for accessing Heroku.
|
|
//
|
|
func (c *Config) Client() (*heroku.Service, error) {
|
|
service := heroku.NewService(&http.Client{
|
|
Transport: &heroku.Transport{
|
|
Username: c.Email,
|
|
Password: c.APIKey,
|
|
UserAgent: heroku.DefaultUserAgent,
|
|
},
|
|
})
|
|
|
|
log.Printf("[INFO] Heroku Client configured for user: %s", c.Email)
|
|
|
|
return service, nil
|
|
}
|