|
5 | 5 | "strings"
|
6 | 6 |
|
7 | 7 | "github.com/hashicorp/terraform-plugin-sdk/helper/schema"
|
| 8 | + "github.com/hashicorp/terraform-plugin-sdk/httpclient" |
8 | 9 | "github.com/hashicorp/terraform-plugin-sdk/terraform"
|
9 | 10 | )
|
10 | 11 |
|
@@ -122,13 +123,16 @@ func init() {
|
122 | 123 |
|
123 | 124 | func providerConfigure(p *schema.Provider, d *schema.ResourceData) (interface{}, error) {
|
124 | 125 | config := Config{
|
125 |
| - Token: d.Get("token").(string), |
126 |
| - BaseURL: d.Get("base_url").(string), |
127 |
| - CACertFile: d.Get("cacert_file").(string), |
128 |
| - Insecure: d.Get("insecure").(bool), |
129 |
| - ClientCert: d.Get("client_cert").(string), |
130 |
| - ClientKey: d.Get("client_key").(string), |
131 |
| - TerraformVersion: p.TerraformVersion, |
| 126 | + Token: d.Get("token").(string), |
| 127 | + BaseURL: d.Get("base_url").(string), |
| 128 | + CACertFile: d.Get("cacert_file").(string), |
| 129 | + Insecure: d.Get("insecure").(bool), |
| 130 | + ClientCert: d.Get("client_cert").(string), |
| 131 | + ClientKey: d.Get("client_key").(string), |
| 132 | + |
| 133 | + // NOTE: httpclient.TerraformUserAgent is deprecated and removed in Terraform SDK v2 |
| 134 | + // After upgrading the SDK to v2 replace with p.UserAgent() |
| 135 | + TerraformUserAgent: httpclient.TerraformUserAgent(p.TerraformVersion), |
132 | 136 | }
|
133 | 137 |
|
134 | 138 | return config.Client()
|
|
0 commit comments