Skip to content
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

fix(cam): [121287135] tencentcloud_cam_role_permission_boundary_attachment fix code panic #3026

Merged
merged 2 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
```

Loading