4 "github.com/DreamItGetIT/statuscake"
5 "github.com/hashicorp/terraform/helper/schema"
6 "github.com/hashicorp/terraform/terraform"
9 func Provider() terraform.ResourceProvider {
10 return &schema.Provider{
11 Schema: map[string]*schema.Schema{
13 Type: schema.TypeString,
15 DefaultFunc: schema.EnvDefaultFunc("STATUSCAKE_USERNAME", nil),
16 Description: "Username for StatusCake Account.",
19 Type: schema.TypeString,
21 DefaultFunc: schema.EnvDefaultFunc("STATUSCAKE_APIKEY", nil),
22 Description: "API Key for StatusCake",
26 ResourcesMap: map[string]*schema.Resource{
27 "statuscake_test": resourceStatusCakeTest(),
28 "statuscake_ssl": resourceStatusCakeSsl(),
31 ConfigureFunc: providerConfigure,
35 func providerConfigure(d *schema.ResourceData) (interface{}, error) {
36 auth := statuscake.Auth{
37 Username: d.Get("username").(string),
38 Apikey: d.Get("apikey").(string),
40 return statuscake.New(auth)