diff --git a/docs/resources/gaussdb_mysql_instance.md b/docs/resources/gaussdb_mysql_instance.md index 38786efdcc..0184f177ef 100644 --- a/docs/resources/gaussdb_mysql_instance.md +++ b/docs/resources/gaussdb_mysql_instance.md @@ -73,6 +73,10 @@ The following arguments are supported: * `enterprise_project_id` - (Optional, String, ForceNew) Specifies the enterprise project id. Required if EPS enabled. Changing this parameter will create a new resource. +* `table_name_case_sensitivity` - (Optional, Bool) Whether the kernel table name is case sensitive. + The value can be `true` (case sensitive) and `false` (case insensitive). Defaults to `false`. + This parameter only works during creation. + * `read_replicas` - (Optional, Int) Specifies the count of read replicas. Defaults to 1. * `time_zone` - (Optional, String, ForceNew) Specifies the time zone. Defaults to "UTC+08:00". diff --git a/go.mod b/go.mod index a3c6a83098..e8cc9b1585 100644 --- a/go.mod +++ b/go.mod @@ -5,8 +5,7 @@ go 1.14 require ( github.com/hashicorp/errwrap v1.0.0 github.com/hashicorp/terraform-plugin-sdk v1.16.0 - github.com/hashicorp/terraform-plugin-test v1.3.0 // indirect - github.com/huaweicloud/golangsdk v0.0.0-20210318062012-78ebc939936a + github.com/huaweicloud/golangsdk v0.0.0-20210323020602-6d5ee0030244 github.com/jen20/awspolicyequivalence v1.1.0 github.com/smartystreets/goconvey v0.0.0-20190222223459-a17d461953aa // indirect github.com/stretchr/testify v1.4.0 diff --git a/go.sum b/go.sum index c40ef7a828..ff0ba61927 100644 --- a/go.sum +++ b/go.sum @@ -184,8 +184,6 @@ github.com/hashicorp/go-hclog v0.9.2 h1:CG6TE5H9/JXsFWJCfoIVpKFIkFe6ysEuHirp4DxC github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-plugin v1.0.1 h1:4OtAfUGbnKC6yS48p0CtMX2oFYtzFZVv6rok3cRWgnE= -github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= github.com/hashicorp/go-plugin v1.3.0 h1:4d/wJojzvHV1I4i/rrjVaeuyxWrLzDE1mDCyDy8fXS8= github.com/hashicorp/go-plugin v1.3.0/go.mod h1:F9eH4LrE/ZsRdbwhfjs9k9HoDUwAHnYtXdgmf1AVNs0= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= @@ -215,13 +213,10 @@ github.com/hashicorp/terraform-config-inspect v0.0.0-20191115094559-17f92b0546e8 github.com/hashicorp/terraform-config-inspect v0.0.0-20191115094559-17f92b0546e8/go.mod h1:p+ivJws3dpqbp1iP84+npOyAmTTOLMgCzrXd3GSdn/A= github.com/hashicorp/terraform-exec v0.10.0 h1:3nh/1e3u9gYRUQGOKWp/8wPR7ABlL2F14sZMZBrp+dM= github.com/hashicorp/terraform-exec v0.10.0/go.mod h1:tOT8j1J8rP05bZBGWXfMyU3HkLi1LWyqL3Bzsc3CJjo= -github.com/hashicorp/terraform-json v0.4.0/go.mod h1:eAbqb4w0pSlRmdvl8fOyHAi/+8jnkVYN28gJkSJrLhU= github.com/hashicorp/terraform-json v0.5.0 h1:7TV3/F3y7QVSuN4r9BEXqnWqrAyeOtON8f0wvREtyzs= github.com/hashicorp/terraform-json v0.5.0/go.mod h1:eAbqb4w0pSlRmdvl8fOyHAi/+8jnkVYN28gJkSJrLhU= github.com/hashicorp/terraform-plugin-sdk v1.16.0 h1:NrkXMRjHErUPPTHQkZ6JIn6bByiJzGnlJzH1rVdNEuE= github.com/hashicorp/terraform-plugin-sdk v1.16.0/go.mod h1:5sVxrwW6/xzFhZyql+Q9zXCUEJaGWcBIxBbZFLpVXOI= -github.com/hashicorp/terraform-plugin-test v1.3.0 h1:hU5LoxrOn9qvOo+LTKN6mSav2J+dAMprbdxJPEQvp4U= -github.com/hashicorp/terraform-plugin-test v1.3.0/go.mod h1:QIJHYz8j+xJtdtLrFTlzQVC0ocr3rf/OjIpgZLK56Hs= github.com/hashicorp/terraform-plugin-test/v2 v2.1.2 h1:p96IIn+XpvVjw7AtN8y9MKxn0x69S7wtbGf7JgDJoIk= github.com/hashicorp/terraform-plugin-test/v2 v2.1.2/go.mod h1:jerO5mrd+jVNALy8aiq+VZOg/CR8T2T1QR3jd6JKGOI= github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596 h1:hjyO2JsNZUKT1ym+FAdlBEkGPevazYsmVgIMw7dVELg= @@ -230,8 +225,8 @@ github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb h1:b5rjCoWHc7eqmAS github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= -github.com/huaweicloud/golangsdk v0.0.0-20210318062012-78ebc939936a h1:AGoBPi9r2eshG9CnJyle8QsuN/ySNyvCojUxXAwvVgE= -github.com/huaweicloud/golangsdk v0.0.0-20210318062012-78ebc939936a/go.mod h1:fcOI5u+0f62JtJd7zkCch/Z57BNC6bhqb32TKuiF4r0= +github.com/huaweicloud/golangsdk v0.0.0-20210323020602-6d5ee0030244 h1:Jzq3828aWxaRquRxPqv8aG1A6B+LatrIHiD3SMlHpFM= +github.com/huaweicloud/golangsdk v0.0.0-20210323020602-6d5ee0030244/go.mod h1:fcOI5u+0f62JtJd7zkCch/Z57BNC6bhqb32TKuiF4r0= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.9 h1:UauaLniWCFHWd+Jp9oCEkTBj8VO/9DKg3PV3VCNMDIg= github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= diff --git a/huaweicloud/resource_huaweicloud_gaussdb_mysql_instance.go b/huaweicloud/resource_huaweicloud_gaussdb_mysql_instance.go index 7150d5ef0f..d4b391bdc1 100644 --- a/huaweicloud/resource_huaweicloud_gaussdb_mysql_instance.go +++ b/huaweicloud/resource_huaweicloud_gaussdb_mysql_instance.go @@ -78,6 +78,10 @@ func resourceGaussDBInstance() *schema.Resource { Optional: true, ForceNew: true, }, + "table_name_case_sensitivity": { + Type: schema.TypeBool, + Optional: true, + }, "read_replicas": { Type: schema.TypeInt, Optional: true, @@ -309,6 +313,12 @@ func resourceGaussDBInstanceCreate(d *schema.ResourceData, meta interface{}) err Mode: "Cluster", DataStore: resourceGaussDBDataStore(d), } + + if d.Get("table_name_case_sensitivity").(bool) { + lowerCaseTableNames := 0 + createOpts.LowerCaseTableNames = &lowerCaseTableNames + } + azMode := d.Get("availability_zone_mode").(string) createOpts.AZMode = azMode if azMode == "multi" { diff --git a/vendor/github.com/huaweicloud/golangsdk/openstack/taurusdb/v3/instances/requests.go b/vendor/github.com/huaweicloud/golangsdk/openstack/taurusdb/v3/instances/requests.go index ef466fde20..99d15cb3ad 100644 --- a/vendor/github.com/huaweicloud/golangsdk/openstack/taurusdb/v3/instances/requests.go +++ b/vendor/github.com/huaweicloud/golangsdk/openstack/taurusdb/v3/instances/requests.go @@ -42,6 +42,7 @@ type CreateTaurusDBOpts struct { MasterAZ string `json:"master_availability_zone,omitempty"` ConfigurationId string `json:"configuration_id,omitempty"` EnterpriseProjectId string `json:"enterprise_project_id,omitempty"` + LowerCaseTableNames *int `json:"lower_case_table_names,omitempty"` DataStore DataStoreOpt `json:"datastore" required:"true"` BackupStrategy *BackupStrategyOpt `json:"backup_strategy,omitempty"` ChargeInfo *ChargeInfoOpt `json:"charge_info,omitempty"` diff --git a/vendor/modules.txt b/vendor/modules.txt index f7f0e7cf8f..3f070acbac 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -249,8 +249,6 @@ github.com/hashicorp/terraform-plugin-sdk/internal/version github.com/hashicorp/terraform-plugin-sdk/meta github.com/hashicorp/terraform-plugin-sdk/plugin github.com/hashicorp/terraform-plugin-sdk/terraform -# github.com/hashicorp/terraform-plugin-test v1.3.0 -## explicit # github.com/hashicorp/terraform-plugin-test/v2 v2.1.2 github.com/hashicorp/terraform-plugin-test/v2 # github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596 @@ -259,7 +257,7 @@ github.com/hashicorp/terraform-svchost/auth github.com/hashicorp/terraform-svchost/disco # github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d github.com/hashicorp/yamux -# github.com/huaweicloud/golangsdk v0.0.0-20210318062012-78ebc939936a +# github.com/huaweicloud/golangsdk v0.0.0-20210323020602-6d5ee0030244 ## explicit github.com/huaweicloud/golangsdk github.com/huaweicloud/golangsdk/internal