Skip to content

Commit

Permalink
Add gaussdb instance resource and docs (#350)
Browse files Browse the repository at this point in the history
* add a common method to init ServiceClient

* Add gaussdb instance resource and docs
  • Loading branch information
ShiChangkuo authored Jun 30, 2020
1 parent a08d401 commit 29d45ce
Show file tree
Hide file tree
Showing 14 changed files with 1,005 additions and 2 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ require (
github.com/hashicorp/errwrap v1.0.0
github.com/hashicorp/go-cleanhttp v0.5.1
github.com/hashicorp/terraform-plugin-sdk v1.13.0
github.com/huaweicloud/golangsdk v0.0.0-20200619095000-03444f871c13
github.com/huaweicloud/golangsdk v0.0.0-20200630015217-45223898b76a
github.com/jen20/awspolicyequivalence v0.0.0-20170831201602-3d48364a137a
github.com/mitchellh/go-homedir v1.1.0
github.com/smartystreets/goconvey v0.0.0-20190222223459-a17d461953aa // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ github.com/huaweicloud/golangsdk v0.0.0-20200615044122-296c30220a0c h1:VLEty8RjU
github.com/huaweicloud/golangsdk v0.0.0-20200615044122-296c30220a0c/go.mod h1:WQBcHRNX9shz3928lWEvstQJtAtYI7ks6XlgtRT9Tcw=
github.com/huaweicloud/golangsdk v0.0.0-20200619095000-03444f871c13 h1:JomfIDZddMDb/oV84a9X+VN1m/TPJwo0SZ6+Efguy8s=
github.com/huaweicloud/golangsdk v0.0.0-20200619095000-03444f871c13/go.mod h1:WQBcHRNX9shz3928lWEvstQJtAtYI7ks6XlgtRT9Tcw=
github.com/huaweicloud/golangsdk v0.0.0-20200630015217-45223898b76a h1:V3MolC7F078F1V+E/9vxWIXp6Krgl95zU1cG7vok2a0=
github.com/huaweicloud/golangsdk v0.0.0-20200630015217-45223898b76a/go.mod h1:WQBcHRNX9shz3928lWEvstQJtAtYI7ks6XlgtRT9Tcw=
github.com/jen20/awspolicyequivalence v0.0.0-20170831201602-3d48364a137a h1:FyS/ubzBR5xJlnJGRTwe7GUHpJOR4ukYK3y+LFNffuA=
github.com/jen20/awspolicyequivalence v0.0.0-20170831201602-3d48364a137a/go.mod h1:uoIMjNxUfXi48Ci40IXkPRbghZ1vbti6v9LCbNqRgHY=
github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
Expand Down
8 changes: 8 additions & 0 deletions huaweicloud/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,14 @@ func (c *Config) FgsV2Client(region string) (*golangsdk.ServiceClient, error) {
})
}

func (c *Config) initServiceClient(srv, region, apiVersion string) (*golangsdk.ServiceClient, error) {
var eo = golangsdk.EndpointOpts{
Name: srv,
Region: c.determineRegion(region),
}
return huaweisdk.InitServiceClientByName(c.HwClient, eo, apiVersion)
}

func (c *Config) sdkClient(region, serviceType string, level string) (*golangsdk.ServiceClient, error) {
client := c.HwClient
if level == serviceDomainLevel {
Expand Down
1 change: 1 addition & 0 deletions huaweicloud/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ func Provider() terraform.ResourceProvider {
"huaweicloud_rds_instance_v1": resourceRdsInstance(),
"huaweicloud_rds_instance_v3": resourceRdsInstanceV3(),
"huaweicloud_rds_parametergroup_v3": resourceRdsConfigurationV3(),
"huaweicloud_gaussdb_instance": resourceGaussDBInstance(),
"huaweicloud_geminidb_instance": resourceGeminiDBInstanceV3(),
"huaweicloud_nat_gateway_v2": resourceNatGatewayV2(),
"huaweicloud_nat_snat_rule_v2": resourceNatSnatRuleV2(),
Expand Down
Loading

0 comments on commit 29d45ce

Please sign in to comment.