diff --git a/builtin/bins/provider-aws/main.go b/builtin/bins/provider-aws/main.go index 813b68b3d9..5ff7a4ab22 100644 --- a/builtin/bins/provider-aws/main.go +++ b/builtin/bins/provider-aws/main.go @@ -3,8 +3,13 @@ package main import ( "github.com/hashicorp/terraform/builtin/providers/aws" "github.com/hashicorp/terraform/plugin" + "github.com/hashicorp/terraform/terraform" ) func main() { - plugin.Serve(new(aws.ResourceProvider)) + plugin.Serve(&plugin.ServeOpts{ + ProviderFunc: func() terraform.ResourceProvider { + return new(aws.ResourceProvider) + }, + }) } diff --git a/builtin/bins/provider-cloudflare/main.go b/builtin/bins/provider-cloudflare/main.go index 3edd2456fd..c81c552e78 100644 --- a/builtin/bins/provider-cloudflare/main.go +++ b/builtin/bins/provider-cloudflare/main.go @@ -3,8 +3,13 @@ package main import ( "github.com/hashicorp/terraform/builtin/providers/cloudflare" "github.com/hashicorp/terraform/plugin" + "github.com/hashicorp/terraform/terraform" ) func main() { - plugin.Serve(new(cloudflare.ResourceProvider)) + plugin.Serve(&plugin.ServeOpts{ + ProviderFunc: func() terraform.ResourceProvider { + return new(cloudflare.ResourceProvider) + }, + }) } diff --git a/builtin/bins/provider-consul/main.go b/builtin/bins/provider-consul/main.go index 1f0b52a2a0..44a8b8e395 100644 --- a/builtin/bins/provider-consul/main.go +++ b/builtin/bins/provider-consul/main.go @@ -3,8 +3,13 @@ package main import ( "github.com/hashicorp/terraform/builtin/providers/consul" "github.com/hashicorp/terraform/plugin" + "github.com/hashicorp/terraform/terraform" ) func main() { - plugin.Serve(new(consul.ResourceProvider)) + plugin.Serve(&plugin.ServeOpts{ + ProviderFunc: func() terraform.ResourceProvider { + return new(consul.ResourceProvider) + }, + }) } diff --git a/builtin/bins/provider-digitalocean/main.go b/builtin/bins/provider-digitalocean/main.go index 3a4d2c46cd..86d2acf7ae 100644 --- a/builtin/bins/provider-digitalocean/main.go +++ b/builtin/bins/provider-digitalocean/main.go @@ -3,8 +3,13 @@ package main import ( "github.com/hashicorp/terraform/builtin/providers/digitalocean" "github.com/hashicorp/terraform/plugin" + "github.com/hashicorp/terraform/terraform" ) func main() { - plugin.Serve(new(digitalocean.ResourceProvider)) + plugin.Serve(&plugin.ServeOpts{ + ProviderFunc: func() terraform.ResourceProvider { + return new(digitalocean.ResourceProvider) + }, + }) } diff --git a/builtin/bins/provider-dnsimple/main.go b/builtin/bins/provider-dnsimple/main.go index 44860d71bf..2c578ace29 100644 --- a/builtin/bins/provider-dnsimple/main.go +++ b/builtin/bins/provider-dnsimple/main.go @@ -3,8 +3,13 @@ package main import ( "github.com/hashicorp/terraform/builtin/providers/dnsimple" "github.com/hashicorp/terraform/plugin" + "github.com/hashicorp/terraform/terraform" ) func main() { - plugin.Serve(new(dnsimple.ResourceProvider)) + plugin.Serve(&plugin.ServeOpts{ + ProviderFunc: func() terraform.ResourceProvider { + return new(dnsimple.ResourceProvider) + }, + }) } diff --git a/builtin/bins/provider-google/main.go b/builtin/bins/provider-google/main.go index 4694888059..2772ce1fcf 100644 --- a/builtin/bins/provider-google/main.go +++ b/builtin/bins/provider-google/main.go @@ -6,5 +6,7 @@ import ( ) func main() { - plugin.Serve(google.Provider()) + plugin.Serve(&plugin.ServeOpts{ + ProviderFunc: google.Provider, + }) } diff --git a/builtin/bins/provider-heroku/main.go b/builtin/bins/provider-heroku/main.go index 92e18cca90..03b13523c8 100644 --- a/builtin/bins/provider-heroku/main.go +++ b/builtin/bins/provider-heroku/main.go @@ -6,5 +6,7 @@ import ( ) func main() { - plugin.Serve(heroku.Provider()) + plugin.Serve(&plugin.ServeOpts{ + ProviderFunc: heroku.Provider, + }) } diff --git a/builtin/bins/provider-mailgun/main.go b/builtin/bins/provider-mailgun/main.go index 768604feb0..6d7caa3da4 100644 --- a/builtin/bins/provider-mailgun/main.go +++ b/builtin/bins/provider-mailgun/main.go @@ -6,5 +6,7 @@ import ( ) func main() { - plugin.Serve(mailgun.Provider()) + plugin.Serve(&plugin.ServeOpts{ + ProviderFunc: mailgun.Provider, + }) } diff --git a/builtin/bins/provisioner-file/main.go b/builtin/bins/provisioner-file/main.go index 6b67478033..592ff53a64 100644 --- a/builtin/bins/provisioner-file/main.go +++ b/builtin/bins/provisioner-file/main.go @@ -3,8 +3,13 @@ package main import ( "github.com/hashicorp/terraform/builtin/provisioners/file" "github.com/hashicorp/terraform/plugin" + "github.com/hashicorp/terraform/terraform" ) func main() { - plugin.Serve(new(file.ResourceProvisioner)) + plugin.Serve(&plugin.ServeOpts{ + ProvisionerFunc: func() terraform.ResourceProvisioner { + return new(file.ResourceProvisioner) + }, + }) } diff --git a/builtin/bins/provisioner-local-exec/main.go b/builtin/bins/provisioner-local-exec/main.go index eb697e57bd..87a70c6ce5 100644 --- a/builtin/bins/provisioner-local-exec/main.go +++ b/builtin/bins/provisioner-local-exec/main.go @@ -3,8 +3,13 @@ package main import ( "github.com/hashicorp/terraform/builtin/provisioners/local-exec" "github.com/hashicorp/terraform/plugin" + "github.com/hashicorp/terraform/terraform" ) func main() { - plugin.Serve(new(localexec.ResourceProvisioner)) + plugin.Serve(&plugin.ServeOpts{ + ProvisionerFunc: func() terraform.ResourceProvisioner { + return new(localexec.ResourceProvisioner) + }, + }) } diff --git a/builtin/bins/provisioner-remote-exec/main.go b/builtin/bins/provisioner-remote-exec/main.go index b7b2c53b47..e9874cbbe2 100644 --- a/builtin/bins/provisioner-remote-exec/main.go +++ b/builtin/bins/provisioner-remote-exec/main.go @@ -3,8 +3,13 @@ package main import ( "github.com/hashicorp/terraform/builtin/provisioners/remote-exec" "github.com/hashicorp/terraform/plugin" + "github.com/hashicorp/terraform/terraform" ) func main() { - plugin.Serve(new(remoteexec.ResourceProvisioner)) + plugin.Serve(&plugin.ServeOpts{ + ProvisionerFunc: func() terraform.ResourceProvisioner { + return new(remoteexec.ResourceProvisioner) + }, + }) } diff --git a/builtin/providers/google/provider.go b/builtin/providers/google/provider.go index 5fbba686a0..593b8559b5 100644 --- a/builtin/providers/google/provider.go +++ b/builtin/providers/google/provider.go @@ -2,10 +2,11 @@ package google import ( "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform/terraform" ) // Provider returns a terraform.ResourceProvider. -func Provider() *schema.Provider { +func Provider() terraform.ResourceProvider { return &schema.Provider{ Schema: map[string]*schema.Schema{ "account_file": &schema.Schema{ diff --git a/builtin/providers/heroku/provider.go b/builtin/providers/heroku/provider.go index f1cf6085c1..dabd9cda5e 100644 --- a/builtin/providers/heroku/provider.go +++ b/builtin/providers/heroku/provider.go @@ -4,11 +4,12 @@ import ( "log" "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform/terraform" "github.com/mitchellh/mapstructure" ) // Provider returns a terraform.ResourceProvider. -func Provider() *schema.Provider { +func Provider() terraform.ResourceProvider { return &schema.Provider{ Schema: map[string]*schema.Schema{ "email": &schema.Schema{ diff --git a/builtin/providers/mailgun/provider.go b/builtin/providers/mailgun/provider.go index 25d29b343b..833e682ad6 100644 --- a/builtin/providers/mailgun/provider.go +++ b/builtin/providers/mailgun/provider.go @@ -4,11 +4,12 @@ import ( "log" "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform/terraform" "github.com/mitchellh/mapstructure" ) // Provider returns a terraform.ResourceProvider. -func Provider() *schema.Provider { +func Provider() terraform.ResourceProvider { return &schema.Provider{ Schema: map[string]*schema.Schema{ "api_key": &schema.Schema{