@@ -29,6 +29,21 @@ func TestAccTencentCloudCamMfaFlagResource_basic(t *testing.T) {
2929 resource .TestCheckResourceAttr ("tencentcloud_cam_mfa_flag.mfa_flag" , "action_flag.0.wechat" , "0" ),
3030 ),
3131 },
32+ {
33+ Config : testAccCamMfaFlagUpdate ,
34+ Check : resource .ComposeTestCheckFunc (
35+ resource .TestCheckResourceAttrSet ("tencentcloud_cam_mfa_flag.mfa_flag" , "id" ),
36+ resource .TestCheckResourceAttrSet ("tencentcloud_cam_mfa_flag.mfa_flag" , "login_flag.#" ),
37+ resource .TestCheckResourceAttr ("tencentcloud_cam_mfa_flag.mfa_flag" , "login_flag.0.phone" , "0" ),
38+ resource .TestCheckResourceAttr ("tencentcloud_cam_mfa_flag.mfa_flag" , "login_flag.0.stoken" , "0" ),
39+ resource .TestCheckResourceAttr ("tencentcloud_cam_mfa_flag.mfa_flag" , "login_flag.0.wechat" , "0" ),
40+
41+ resource .TestCheckResourceAttrSet ("tencentcloud_cam_mfa_flag.mfa_flag" , "action_flag.#" ),
42+ resource .TestCheckResourceAttr ("tencentcloud_cam_mfa_flag.mfa_flag" , "action_flag.0.phone" , "0" ),
43+ resource .TestCheckResourceAttr ("tencentcloud_cam_mfa_flag.mfa_flag" , "action_flag.0.stoken" , "0" ),
44+ resource .TestCheckResourceAttr ("tencentcloud_cam_mfa_flag.mfa_flag" , "action_flag.0.wechat" , "0" ),
45+ ),
46+ },
3247 },
3348 })
3449}
@@ -39,14 +54,32 @@ data "tencentcloud_user_info" "info"{}
3954resource "tencentcloud_cam_mfa_flag" "mfa_flag" {
4055 op_uin = data.tencentcloud_user_info.info.uin
4156 login_flag {
42- phone = 0
43- stoken = 1
44- wechat = 0
57+ phone = 0
58+ stoken = 1
59+ wechat = 0
60+ }
61+ action_flag {
62+ phone = 0
63+ stoken = 1
64+ wechat = 0
65+ }
66+ }
67+
68+ `
69+ const testAccCamMfaFlagUpdate = `
70+ data "tencentcloud_user_info" "info"{}
71+
72+ resource "tencentcloud_cam_mfa_flag" "mfa_flag" {
73+ op_uin = data.tencentcloud_user_info.info.uin
74+ login_flag {
75+ phone = 0
76+ stoken = 0
77+ wechat = 0
4578 }
4679 action_flag {
47- phone = 0
48- stoken = 1
49- wechat = 0
80+ phone = 0
81+ stoken = 0
82+ wechat = 0
5083 }
5184}
5285
0 commit comments