-
Notifications
You must be signed in to change notification settings - Fork 555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
resource/alicloud_db_instance: fix_add_ModifyDBInstanceConfig #7944
base: master
Are you sure you want to change the base?
resource/alicloud_db_instance: fix_add_ModifyDBInstanceConfig #7944
Conversation
5e18672
to
2bd60d2
Compare
23bbda7
to
95e2679
Compare
alicloud/diff_suppress_funcs.go
Outdated
engine := d.Get("engine").(string) | ||
encryptionKey := d.Get("encryption_key").(string) | ||
|
||
// 检查 engine 不是 PostgreSQL、MySQL 或 SQLServer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
无效的注释去掉;工具类函数需要增加单测覆盖
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
无效注释已去掉,已放回资源类。
02110e7
to
f3ac1e2
Compare
f3ac1e2
to
6bf98c6
Compare
@@ -1017,6 +1017,16 @@ func TestAccAliCloudRdsDBInstance_SQLServer(t *testing.T) { | |||
}), | |||
), | |||
}, | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
新增字段recovery_model和pg_bouncer_enabled,当前只覆盖了更新操作,没有在创建操作指定的单测,需要在别的单测里面指定覆盖一下。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已在新增中覆盖
@@ -397,7 +397,20 @@ func resourceAliCloudDBInstance() *schema.Resource { | |||
Type: schema.TypeString, | |||
Optional: true, | |||
DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { | |||
return d.Get("engine").(string) != "PostgreSQL" && d.Get("engine").(string) != "MySQL" && d.Get("engine").(string) != "SQLServer" | |||
engine := d.Get("engine").(string) | |||
encryptionKey := d.Get("encryption_key").(string) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
encryption_key 是非必填的,这里直接断言会不会异常?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -1763,6 +1853,8 @@ func resourceAliCloudDBInstanceRead(d *schema.ResourceData, meta interface{}) er | |||
} else if len(slaveZones) == 1 { | |||
d.Set("zone_id_slave_a", slaveZones[0].(map[string]interface{})["ZoneId"]) | |||
} | |||
recoveryModel := instance["Extra"].(map[string]interface{})["RecoveryModel"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
接口上一定会返回这个结构吗,不返回的情况下这里的断言会直接抛出异常
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* `encryption_key` - (Optional, Available since 1.109.0) The key id of the KMS. Used for encrypting a disk if not null. Only for PostgreSQL, MySQL and SQLServer. | ||
When the instance is PostgreSQL, this parameter can be used to enable, modify, and disable cloud disk encryption.Value range: | ||
- ServiceKey: Enable disk encryption using the service-managed key (Default Service CMK) automatically generated by Alibaba Cloud RDS. | ||
- <密钥>: Use a custom key to enable cloud disk encryption or change the current key. For example: 494c98ce-f2b5-48ab-96ab-36c986b6****. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为什么有中文
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
本意想代表此处可以填自定义密钥
已翻译成英文。
65a5204
to
0ef5412
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approved
878a2ef
to
e20b5fb
Compare
@@ -3179,6 +3212,7 @@ func TestAccAliCloudRdsDBInstance_SQLServer_2019_ServerlessHA(t *testing.T) { | |||
"serverless_config.#": "1", | |||
"serverless_config.0.max_capacity": "8", | |||
"serverless_config.0.min_capacity": "2", | |||
"recovery_model": "simple", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修复
e20b5fb
to
8ccc958
Compare
8ccc958
to
41d48c0
Compare
No description provided.