Skip to content

Commit e3bfd04

Browse files
authored
fix(bh): [116555803] Fix errors in querying user group members (#2564)
* add * add * fix/bh * fix/bh * fix/bh
1 parent 9411778 commit e3bfd04

27 files changed

+159
-40
lines changed

.changelog/2564.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
resource/tencentcloud_dasb_user_group_members: Fix errors in querying user group members
3+
```

tencentcloud/provider.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2088,7 +2088,6 @@ Bastion Host(BH)
20882088
tencentcloud_dasb_device_group_members
20892089
tencentcloud_dasb_user_group_members
20902090
tencentcloud_dasb_bind_device_resource
2091-
tencentcloud_dasb_resource
20922091
tencentcloud_dasb_device
20932092
tencentcloud_dasb_user_group
20942093
tencentcloud_dasb_reset_user

tencentcloud/services/bh/resource_tc_dasb_acl.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,13 @@ func ResourceTencentCloudDasbAcl() *schema.Resource {
149149
},
150150
"validate_from": {
151151
Optional: true,
152+
Computed: true,
152153
Type: schema.TypeString,
153154
Description: "Access permission effective time, such as: 2021-09-22T00:00:00+08:00If the effective and expiry time are not filled in, the access rights will be valid for a long time.",
154155
},
155156
"validate_to": {
156157
Optional: true,
158+
Computed: true,
157159
Type: schema.TypeString,
158160
Description: "Access permission expiration time, such as: 2021-09-23T00:00:00+08:00If the effective and expiry time are not filled in, the access rights will be valid for a long time.",
159161
},

tencentcloud/services/bh/resource_tc_dasb_bind_device_account_password.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,20 @@ Provides a resource to create a dasb bind_device_account_password
33
Example Usage
44

55
```hcl
6+
resource "tencentcloud_dasb_device" "example" {
7+
os_name = "Linux"
8+
ip = "192.168.0.1"
9+
port = 80
10+
name = "tf_example"
11+
}
12+
13+
resource "tencentcloud_dasb_device_account" "example" {
14+
device_id = tencentcloud_dasb_device.example.id
15+
account = "root"
16+
}
17+
618
resource "tencentcloud_dasb_bind_device_account_password" "example" {
7-
device_account_id = 16
19+
device_account_id = tencentcloud_dasb_device_account.example.id
820
password = "TerraformPassword"
921
}
1022
```

tencentcloud/services/bh/resource_tc_dasb_bind_device_account_private_key.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,20 @@ Provides a resource to create a dasb bind_device_account_private_key
33
Example Usage
44

55
```hcl
6+
resource "tencentcloud_dasb_device" "example" {
7+
os_name = "Linux"
8+
ip = "192.168.0.1"
9+
port = 80
10+
name = "tf_example"
11+
}
12+
13+
resource "tencentcloud_dasb_device_account" "example" {
14+
device_id = tencentcloud_dasb_device.example.id
15+
account = "root"
16+
}
17+
618
resource "tencentcloud_dasb_bind_device_account_private_key" "example" {
7-
device_account_id = 16
19+
device_account_id = tencentcloud_dasb_device_account.example.id
820
private_key = "MIICXAIBAAKBgQCqGKukO1De7zhZj6+H0qtjTkVxwTCpvKe4eCZ0FPqri0cb2JZfXJ/DgYSF6vUpwmJG8wVQZKjeGcjDOL5UlsuusFncCzWBQ7RKNUSesmQRMSGkVb1/3j+skZ6UtW+5u09lHNsj6tQ51s1SPrCBkedbNf0Tp0GbMJDyR4e9T04ZZwIDAQABAoGAFijko56+qGyN8M0RVyaRAXz++xTqHBLh"
921
private_key_password = "TerraformPassword"
1022
}

tencentcloud/services/bh/resource_tc_dasb_bind_device_resource.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Example Usage
44

55
```hcl
66
resource "tencentcloud_dasb_bind_device_resource" "example" {
7-
resource_id = "bh-saas-ocmzo6lgxiv"
7+
resource_id = "bh-saas-weyosfym"
88
device_id_set = [17, 18]
99
}
1010
```

tencentcloud/services/bh/resource_tc_dasb_device.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ func ResourceTencentCloudDasbDevice() *schema.Resource {
5555
Type: schema.TypeSet,
5656
Elem: &schema.Schema{Type: schema.TypeString},
5757
Optional: true,
58+
Computed: true,
5859
Description: "Asset multi-node: fields ip and port.",
5960
},
6061
},
@@ -159,8 +160,8 @@ func resourceTencentCloudDasbDeviceRead(d *schema.ResourceData, meta interface{}
159160
_ = d.Set("os_name", device.OsName)
160161
}
161162

162-
if device.PublicIp != nil {
163-
_ = d.Set("ip", device.PublicIp)
163+
if device.PrivateIp != nil {
164+
_ = d.Set("ip", device.PrivateIp)
164165
}
165166

166167
if device.Port != nil {

tencentcloud/services/bh/resource_tc_dasb_device_account.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func resourceTencentCloudDasbDeviceAccountCreate(d *schema.ResourceData, meta in
6767
log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString())
6868
}
6969

70-
if result == nil || result.Response.Id != nil {
70+
if result == nil || result.Response.Id == nil {
7171
e = fmt.Errorf("dasb DeviceAccount not exists")
7272
return resource.NonRetryableError(e)
7373
}

tencentcloud/services/bh/resource_tc_dasb_device_account.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,15 @@ Provides a resource to create a dasb device_account
33
Example Usage
44

55
```hcl
6+
resource "tencentcloud_dasb_device" "example" {
7+
os_name = "Linux"
8+
ip = "192.168.0.1"
9+
port = 80
10+
name = "tf_example"
11+
}
12+
613
resource "tencentcloud_dasb_device_account" "example" {
7-
device_id = 100
14+
device_id = tencentcloud_dasb_device.example.id
815
account = "root"
916
}
1017
```

tencentcloud/services/bh/resource_tc_dasb_device_group_members.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ func resourceTencentCloudDasbDeviceGroupMembersRead(d *schema.ResourceData, meta
124124
return nil
125125
}
126126

127-
_ = d.Set("device_group_id", deviceGroupId)
127+
deviceGroupIdInt, _ := strconv.Atoi(deviceGroupId)
128+
_ = d.Set("device_group_id", deviceGroupIdInt)
128129
_ = d.Set("member_id_set", DeviceGroupMembers)
129130

130131
return nil

0 commit comments

Comments
 (0)