tencentcloud 1.82.34 published on Wednesday, Nov 5, 2025 by tencentcloudstack
tencentcloud.getCamRolePolicyAttachments
Start a Neo task
Explain and create a tencentcloud.getCamRolePolicyAttachments resource
tencentcloud 1.82.34 published on Wednesday, Nov 5, 2025 by tencentcloudstack
Use this data source to query detailed information of CAM role policy attachments
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
// query by role_id
const foo = tencentcloud.getCamRolePolicyAttachments({
roleId: fooTencentcloudCamRole.id,
});
// query by role_id and policy_id
const bar = tencentcloud.getCamRolePolicyAttachments({
roleId: fooTencentcloudCamRole.id,
policyId: fooTencentcloudCamPolicy.id,
});
import pulumi
import pulumi_tencentcloud as tencentcloud
# query by role_id
foo = tencentcloud.get_cam_role_policy_attachments(role_id=foo_tencentcloud_cam_role["id"])
# query by role_id and policy_id
bar = tencentcloud.get_cam_role_policy_attachments(role_id=foo_tencentcloud_cam_role["id"],
policy_id=foo_tencentcloud_cam_policy["id"])
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// query by role_id
_, err := tencentcloud.GetCamRolePolicyAttachments(ctx, &tencentcloud.GetCamRolePolicyAttachmentsArgs{
RoleId: fooTencentcloudCamRole.Id,
}, nil)
if err != nil {
return err
}
// query by role_id and policy_id
_, err = tencentcloud.GetCamRolePolicyAttachments(ctx, &tencentcloud.GetCamRolePolicyAttachmentsArgs{
RoleId: fooTencentcloudCamRole.Id,
PolicyId: pulumi.StringRef(fooTencentcloudCamPolicy.Id),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
// query by role_id
var foo = Tencentcloud.GetCamRolePolicyAttachments.Invoke(new()
{
RoleId = fooTencentcloudCamRole.Id,
});
// query by role_id and policy_id
var bar = Tencentcloud.GetCamRolePolicyAttachments.Invoke(new()
{
RoleId = fooTencentcloudCamRole.Id,
PolicyId = fooTencentcloudCamPolicy.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.TencentcloudFunctions;
import com.pulumi.tencentcloud.inputs.GetCamRolePolicyAttachmentsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
// query by role_id
final var foo = TencentcloudFunctions.getCamRolePolicyAttachments(GetCamRolePolicyAttachmentsArgs.builder()
.roleId(fooTencentcloudCamRole.id())
.build());
// query by role_id and policy_id
final var bar = TencentcloudFunctions.getCamRolePolicyAttachments(GetCamRolePolicyAttachmentsArgs.builder()
.roleId(fooTencentcloudCamRole.id())
.policyId(fooTencentcloudCamPolicy.id())
.build());
}
}
variables:
# query by role_id
foo:
fn::invoke:
function: tencentcloud:getCamRolePolicyAttachments
arguments:
roleId: ${fooTencentcloudCamRole.id}
# query by role_id and policy_id
bar:
fn::invoke:
function: tencentcloud:getCamRolePolicyAttachments
arguments:
roleId: ${fooTencentcloudCamRole.id}
policyId: ${fooTencentcloudCamPolicy.id}
Using getCamRolePolicyAttachments
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getCamRolePolicyAttachments(args: GetCamRolePolicyAttachmentsArgs, opts?: InvokeOptions): Promise<GetCamRolePolicyAttachmentsResult>
function getCamRolePolicyAttachmentsOutput(args: GetCamRolePolicyAttachmentsOutputArgs, opts?: InvokeOptions): Output<GetCamRolePolicyAttachmentsResult>def get_cam_role_policy_attachments(create_mode: Optional[float] = None,
id: Optional[str] = None,
policy_id: Optional[str] = None,
policy_type: Optional[str] = None,
result_output_file: Optional[str] = None,
role_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetCamRolePolicyAttachmentsResult
def get_cam_role_policy_attachments_output(create_mode: Optional[pulumi.Input[float]] = None,
id: Optional[pulumi.Input[str]] = None,
policy_id: Optional[pulumi.Input[str]] = None,
policy_type: Optional[pulumi.Input[str]] = None,
result_output_file: Optional[pulumi.Input[str]] = None,
role_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetCamRolePolicyAttachmentsResult]func GetCamRolePolicyAttachments(ctx *Context, args *GetCamRolePolicyAttachmentsArgs, opts ...InvokeOption) (*GetCamRolePolicyAttachmentsResult, error)
func GetCamRolePolicyAttachmentsOutput(ctx *Context, args *GetCamRolePolicyAttachmentsOutputArgs, opts ...InvokeOption) GetCamRolePolicyAttachmentsResultOutput> Note: This function is named GetCamRolePolicyAttachments in the Go SDK.
public static class GetCamRolePolicyAttachments
{
public static Task<GetCamRolePolicyAttachmentsResult> InvokeAsync(GetCamRolePolicyAttachmentsArgs args, InvokeOptions? opts = null)
public static Output<GetCamRolePolicyAttachmentsResult> Invoke(GetCamRolePolicyAttachmentsInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetCamRolePolicyAttachmentsResult> getCamRolePolicyAttachments(GetCamRolePolicyAttachmentsArgs args, InvokeOptions options)
public static Output<GetCamRolePolicyAttachmentsResult> getCamRolePolicyAttachments(GetCamRolePolicyAttachmentsArgs args, InvokeOptions options)
fn::invoke:
function: tencentcloud:index/getCamRolePolicyAttachments:getCamRolePolicyAttachments
arguments:
# arguments dictionaryThe following arguments are supported:
- Role
Id string - ID of the attached CAM role to be queried.
- Create
Mode double - Mode of Creation of the CAM user policy attachment.
1means the cam policy attachment is created by production, and the others indicate syntax strategy ways. - Id string
- Policy
Id string - ID of CAM policy to be queried.
- Policy
Type string - Type of the policy strategy. Valid values are 'User', 'QCS'. 'User' means customer strategy and 'QCS' means preset strategy.
- Result
Output stringFile - Used to save results.
- Role
Id string - ID of the attached CAM role to be queried.
- Create
Mode float64 - Mode of Creation of the CAM user policy attachment.
1means the cam policy attachment is created by production, and the others indicate syntax strategy ways. - Id string
- Policy
Id string - ID of CAM policy to be queried.
- Policy
Type string - Type of the policy strategy. Valid values are 'User', 'QCS'. 'User' means customer strategy and 'QCS' means preset strategy.
- Result
Output stringFile - Used to save results.
- role
Id String - ID of the attached CAM role to be queried.
- create
Mode Double - Mode of Creation of the CAM user policy attachment.
1means the cam policy attachment is created by production, and the others indicate syntax strategy ways. - id String
- policy
Id String - ID of CAM policy to be queried.
- policy
Type String - Type of the policy strategy. Valid values are 'User', 'QCS'. 'User' means customer strategy and 'QCS' means preset strategy.
- result
Output StringFile - Used to save results.
- role
Id string - ID of the attached CAM role to be queried.
- create
Mode number - Mode of Creation of the CAM user policy attachment.
1means the cam policy attachment is created by production, and the others indicate syntax strategy ways. - id string
- policy
Id string - ID of CAM policy to be queried.
- policy
Type string - Type of the policy strategy. Valid values are 'User', 'QCS'. 'User' means customer strategy and 'QCS' means preset strategy.
- result
Output stringFile - Used to save results.
- role_
id str - ID of the attached CAM role to be queried.
- create_
mode float - Mode of Creation of the CAM user policy attachment.
1means the cam policy attachment is created by production, and the others indicate syntax strategy ways. - id str
- policy_
id str - ID of CAM policy to be queried.
- policy_
type str - Type of the policy strategy. Valid values are 'User', 'QCS'. 'User' means customer strategy and 'QCS' means preset strategy.
- result_
output_ strfile - Used to save results.
- role
Id String - ID of the attached CAM role to be queried.
- create
Mode Number - Mode of Creation of the CAM user policy attachment.
1means the cam policy attachment is created by production, and the others indicate syntax strategy ways. - id String
- policy
Id String - ID of CAM policy to be queried.
- policy
Type String - Type of the policy strategy. Valid values are 'User', 'QCS'. 'User' means customer strategy and 'QCS' means preset strategy.
- result
Output StringFile - Used to save results.
getCamRolePolicyAttachments Result
The following output properties are available:
- Id string
- Role
Id string - ID of CAM role.
- Role
Policy List<GetAttachment Lists Cam Role Policy Attachments Role Policy Attachment List> - A list of CAM role policy attachments. Each element contains the following attributes:
- Create
Mode double - Mode of Creation of the CAM role policy attachment.
1means the cam policy attachment is created by production, and the others indicate syntax strategy ways. - Policy
Id string - Name of CAM role.
- Policy
Type string - Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
- Result
Output stringFile
- Id string
- Role
Id string - ID of CAM role.
- Role
Policy []GetAttachment Lists Cam Role Policy Attachments Role Policy Attachment List - A list of CAM role policy attachments. Each element contains the following attributes:
- Create
Mode float64 - Mode of Creation of the CAM role policy attachment.
1means the cam policy attachment is created by production, and the others indicate syntax strategy ways. - Policy
Id string - Name of CAM role.
- Policy
Type string - Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
- Result
Output stringFile
- id String
- role
Id String - ID of CAM role.
- role
Policy List<GetAttachment Lists Cam Role Policy Attachments Role Policy Attachment List> - A list of CAM role policy attachments. Each element contains the following attributes:
- create
Mode Double - Mode of Creation of the CAM role policy attachment.
1means the cam policy attachment is created by production, and the others indicate syntax strategy ways. - policy
Id String - Name of CAM role.
- policy
Type String - Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
- result
Output StringFile
- id string
- role
Id string - ID of CAM role.
- role
Policy GetAttachment Lists Cam Role Policy Attachments Role Policy Attachment List[] - A list of CAM role policy attachments. Each element contains the following attributes:
- create
Mode number - Mode of Creation of the CAM role policy attachment.
1means the cam policy attachment is created by production, and the others indicate syntax strategy ways. - policy
Id string - Name of CAM role.
- policy
Type string - Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
- result
Output stringFile
- id str
- role_
id str - ID of CAM role.
- role_
policy_ Sequence[Getattachment_ lists Cam Role Policy Attachments Role Policy Attachment List] - A list of CAM role policy attachments. Each element contains the following attributes:
- create_
mode float - Mode of Creation of the CAM role policy attachment.
1means the cam policy attachment is created by production, and the others indicate syntax strategy ways. - policy_
id str - Name of CAM role.
- policy_
type str - Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
- result_
output_ strfile
- id String
- role
Id String - ID of CAM role.
- role
Policy List<Property Map>Attachment Lists - A list of CAM role policy attachments. Each element contains the following attributes:
- create
Mode Number - Mode of Creation of the CAM role policy attachment.
1means the cam policy attachment is created by production, and the others indicate syntax strategy ways. - policy
Id String - Name of CAM role.
- policy
Type String - Type of the policy strategy. 'User' means customer strategy and 'QCS' means preset strategy.
- result
Output StringFile
Supporting Types
GetCamRolePolicyAttachmentsRolePolicyAttachmentList
- Create
Mode double - Mode of Creation of the CAM user policy attachment.
1means the cam policy attachment is created by production, and the others indicate syntax strategy ways. - Create
Time string - Create time of the CAM role policy attachment.
- Policy
Id string - ID of CAM policy to be queried.
- Policy
Name string - Name of the policy.
- Policy
Type string - Type of the policy strategy. Valid values are 'User', 'QCS'. 'User' means customer strategy and 'QCS' means preset strategy.
- Role
Id string - ID of the attached CAM role to be queried.
- Create
Mode float64 - Mode of Creation of the CAM user policy attachment.
1means the cam policy attachment is created by production, and the others indicate syntax strategy ways. - Create
Time string - Create time of the CAM role policy attachment.
- Policy
Id string - ID of CAM policy to be queried.
- Policy
Name string - Name of the policy.
- Policy
Type string - Type of the policy strategy. Valid values are 'User', 'QCS'. 'User' means customer strategy and 'QCS' means preset strategy.
- Role
Id string - ID of the attached CAM role to be queried.
- create
Mode Double - Mode of Creation of the CAM user policy attachment.
1means the cam policy attachment is created by production, and the others indicate syntax strategy ways. - create
Time String - Create time of the CAM role policy attachment.
- policy
Id String - ID of CAM policy to be queried.
- policy
Name String - Name of the policy.
- policy
Type String - Type of the policy strategy. Valid values are 'User', 'QCS'. 'User' means customer strategy and 'QCS' means preset strategy.
- role
Id String - ID of the attached CAM role to be queried.
- create
Mode number - Mode of Creation of the CAM user policy attachment.
1means the cam policy attachment is created by production, and the others indicate syntax strategy ways. - create
Time string - Create time of the CAM role policy attachment.
- policy
Id string - ID of CAM policy to be queried.
- policy
Name string - Name of the policy.
- policy
Type string - Type of the policy strategy. Valid values are 'User', 'QCS'. 'User' means customer strategy and 'QCS' means preset strategy.
- role
Id string - ID of the attached CAM role to be queried.
- create_
mode float - Mode of Creation of the CAM user policy attachment.
1means the cam policy attachment is created by production, and the others indicate syntax strategy ways. - create_
time str - Create time of the CAM role policy attachment.
- policy_
id str - ID of CAM policy to be queried.
- policy_
name str - Name of the policy.
- policy_
type str - Type of the policy strategy. Valid values are 'User', 'QCS'. 'User' means customer strategy and 'QCS' means preset strategy.
- role_
id str - ID of the attached CAM role to be queried.
- create
Mode Number - Mode of Creation of the CAM user policy attachment.
1means the cam policy attachment is created by production, and the others indicate syntax strategy ways. - create
Time String - Create time of the CAM role policy attachment.
- policy
Id String - ID of CAM policy to be queried.
- policy
Name String - Name of the policy.
- policy
Type String - Type of the policy strategy. Valid values are 'User', 'QCS'. 'User' means customer strategy and 'QCS' means preset strategy.
- role
Id String - ID of the attached CAM role to be queried.
Package Details
- Repository
- tencentcloud tencentcloudstack/terraform-provider-tencentcloud
- License
- Notes
- This Pulumi package is based on the
tencentcloudTerraform Provider.
tencentcloud 1.82.34 published on Wednesday, Nov 5, 2025 by tencentcloudstack
