Skip to content

Commit

Permalink
fix(cam): [121287135] `tencentcloud_cam_role_permission_boundary_atta…
Browse files Browse the repository at this point in the history
…chment` fix code panic (#3026)

* add

* add
  • Loading branch information
SevenEarth authored Dec 18, 2024
1 parent 91b8f2e commit 210fd85
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .changelog/3026.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/tencentcloud_cam_role_permission_boundary_attachment: fix code panic
```
Original file line number Diff line number Diff line change
@@ -1,18 +1,43 @@
Provides a resource to create a cam role_permission_boundary_attachment
Provides a resource to create a CAM role permission boundary attachment

Example Usage

Use role_name

```hcl
resource "tencentcloud_cam_role_permission_boundary_attachment" "example" {
policy_id = 1
role_name = "tf-example"
}
```

Use role_id

```hcl
resource "tencentcloud_cam_role_permission_boundary_attachment" "role_permission_boundary_attachment" {
resource "tencentcloud_cam_role_permission_boundary_attachment" "example" {
policy_id = 1
role_name = "test-cam-tag"
role_id = "4611686018441060141"
}
```

Use all

```hcl
resource "tencentcloud_cam_role_permission_boundary_attachment" "example" {
policy_id = 1
role_name = "tf-example"
role_id = "4611686018441060141"
}
```

Import

cam role_permission_boundary_attachment can be imported using the id, e.g.
CAM role permission boundary attachment can be imported using the id, e.g.

```
terraform import tencentcloud_cam_role_permission_boundary_attachment.role_permission_boundary_attachment role_permission_boundary_attachment_id
terraform import tencentcloud_cam_role_permission_boundary_attachment.example 1##tf-example
terraform import tencentcloud_cam_role_permission_boundary_attachment.example 1#4611686018441060141#
terraform import tencentcloud_cam_role_permission_boundary_attachment.example 1#4611686018441060141#tf-example
```
2 changes: 1 addition & 1 deletion tencentcloud/services/cam/service_tencentcloud_cam.go
Original file line number Diff line number Diff line change
Expand Up @@ -1741,7 +1741,7 @@ func (me *CamService) DescribeCamRolePermissionBoundaryAttachmentById(ctx contex
return
}
log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), response.ToJsonString())
if response == nil || response.Response == nil {
if response == nil || response.Response == nil || response.Response.PolicyId == nil {
return
}
if *response.Response.PolicyId != helper.StrToInt64(policyId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,40 @@ layout: "tencentcloud"
page_title: "TencentCloud: tencentcloud_cam_role_permission_boundary_attachment"
sidebar_current: "docs-tencentcloud-resource-cam_role_permission_boundary_attachment"
description: |-
Provides a resource to create a cam role_permission_boundary_attachment
Provides a resource to create a CAM role permission boundary attachment
---

# tencentcloud_cam_role_permission_boundary_attachment

Provides a resource to create a cam role_permission_boundary_attachment
Provides a resource to create a CAM role permission boundary attachment

## Example Usage

### Use role_name

```hcl
resource "tencentcloud_cam_role_permission_boundary_attachment" "example" {
policy_id = 1
role_name = "tf-example"
}
```

### Use role_id

```hcl
resource "tencentcloud_cam_role_permission_boundary_attachment" "role_permission_boundary_attachment" {
resource "tencentcloud_cam_role_permission_boundary_attachment" "example" {
policy_id = 1
role_name = "test-cam-tag"
role_id = "4611686018441060141"
}
```

### Use all

```hcl
resource "tencentcloud_cam_role_permission_boundary_attachment" "example" {
policy_id = 1
role_name = "tf-example"
role_id = "4611686018441060141"
}
```

Expand All @@ -38,9 +59,13 @@ In addition to all arguments above, the following attributes are exported:

## Import

cam role_permission_boundary_attachment can be imported using the id, e.g.
CAM role permission boundary attachment can be imported using the id, e.g.

```
terraform import tencentcloud_cam_role_permission_boundary_attachment.role_permission_boundary_attachment role_permission_boundary_attachment_id
terraform import tencentcloud_cam_role_permission_boundary_attachment.example 1##tf-example
terraform import tencentcloud_cam_role_permission_boundary_attachment.example 1#4611686018441060141#
terraform import tencentcloud_cam_role_permission_boundary_attachment.example 1#4611686018441060141#tf-example
```

0 comments on commit 210fd85

Please sign in to comment.