Skip to content
This repository was archived by the owner on Mar 1, 2023. It is now read-only.

Commit 3abff57

Browse files
committed
client_id added
1 parent ef19e59 commit 3abff57

File tree

5 files changed

+15
-7
lines changed

5 files changed

+15
-7
lines changed

docs/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ terraform {
1818
required_providers {
1919
gcore = {
2020
source = "G-Core/gcorelabs"
21-
version = "0.1.8"
21+
version = "0.1.9"
2222
}
2323
}
2424
}
@@ -245,6 +245,7 @@ resource "gcore_lbmember" "lbm2" {
245245
### Optional
246246

247247
- **gcore_api** (String) Region API
248+
- **gcore_client_id** (String) Client id
248249
- **gcore_platform** (String) Platform ulr is used for generate jwt
249250
- **password** (String)
250251
- **user_name** (String)

examples/provider/provider.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ terraform {
33
required_providers {
44
gcore = {
55
source = "G-Core/gcorelabs"
6-
version = "0.1.8"
6+
version = "0.1.9"
77
}
88
}
99
}

gcore/provider.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ func Provider() *schema.Provider {
3434
Description: "Region API",
3535
DefaultFunc: schema.EnvDefaultFunc("GCORE_API", ""),
3636
},
37+
"gcore_client_id": &schema.Schema{
38+
Type: schema.TypeString,
39+
Optional: true,
40+
Description: "Client id",
41+
DefaultFunc: schema.EnvDefaultFunc("GCORE_CLIENT_ID", ""),
42+
},
3743
},
3844
ResourcesMap: map[string]*schema.Resource{
3945
"gcore_volume": resourceVolume(),
@@ -77,6 +83,7 @@ func providerConfigure(ctx context.Context, d *schema.ResourceData) (interface{}
7783
password := d.Get("password").(string)
7884
api := d.Get("gcore_api").(string)
7985
platform := d.Get("gcore_platform").(string)
86+
clientID := d.Get("gcore_client_id").(string)
8087

8188
var diags diag.Diagnostics
8289

@@ -86,10 +93,12 @@ func providerConfigure(ctx context.Context, d *schema.ResourceData) (interface{}
8693
Username: username,
8794
Password: password,
8895
AllowReauth: true,
96+
ClientID: clientID,
8997
})
9098
if err != nil {
9199
return nil, diag.FromErr(err)
92100
}
101+
93102
config := Config{
94103
Provider: provider,
95104
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/terraform-providers/terraform-provider-gcorelabs
33
go 1.14
44

55
require (
6-
github.com/G-Core/gcorelabscloud-go v0.4.3
6+
github.com/G-Core/gcorelabscloud-go v0.4.4
77
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320
88
github.com/hashicorp/terraform-plugin-sdk/v2 v2.3.0
99
github.com/mitchellh/mapstructure v1.4.0

go.sum

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,8 @@ github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6L
4141
github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk=
4242
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
4343
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
44-
github.com/G-Core/gcorelabscloud-go v0.3.43 h1:DF90DkCD1LketaXjBN1imqlUv4GDfBxh6s+YlQpcjVM=
45-
github.com/G-Core/gcorelabscloud-go v0.3.43/go.mod h1:Z1MF80mWagEUrxygtYkvW/MJEYNmIUPsIEYBB3cKjOM=
46-
github.com/G-Core/gcorelabscloud-go v0.4.3 h1:woDCm0rTiGq0F+nr+RZ33nc5YXcxdBWkeaPRROQ3qcM=
47-
github.com/G-Core/gcorelabscloud-go v0.4.3/go.mod h1:Z1MF80mWagEUrxygtYkvW/MJEYNmIUPsIEYBB3cKjOM=
44+
github.com/G-Core/gcorelabscloud-go v0.4.4 h1:Rbjz4/UtvurjYxUXtokZqiTS8K6ErTf1C9L9iwqzUhI=
45+
github.com/G-Core/gcorelabscloud-go v0.4.4/go.mod h1:Z1MF80mWagEUrxygtYkvW/MJEYNmIUPsIEYBB3cKjOM=
4846
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
4947
github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
5048
github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=

0 commit comments

Comments
 (0)