1. Packages
  2. Packages
  3. Tencentcloud Provider
  4. API Docs
  5. getCamPolicies
Viewing docs for tencentcloud 1.82.91
published on Friday, May 1, 2026 by tencentcloudstack
Viewing docs for tencentcloud 1.82.91
published on Friday, May 1, 2026 by tencentcloudstack

    Use this data source to query detailed information of CAM policies

    Example Usage

    Query all policies

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const example = tencentcloud.getCamPolicies({});
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    example = tencentcloud.get_cam_policies()
    
    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 {
    		_, err := tencentcloud.GetCamPolicies(ctx, &tencentcloud.GetCamPoliciesArgs{}, 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(() => 
    {
        var example = Tencentcloud.GetCamPolicies.Invoke();
    
    });
    
    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.GetCamPoliciesArgs;
    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) {
            final var example = TencentcloudFunctions.getCamPolicies(GetCamPoliciesArgs.builder()
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: tencentcloud:getCamPolicies
          arguments: {}
    

    Query policies by filter

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const example = tencentcloud.getCamPolicies({
        name: "tf-example",
        policyId: "236215899",
        type: 1,
        createMode: 2,
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    example = tencentcloud.get_cam_policies(name="tf-example",
        policy_id="236215899",
        type=1,
        create_mode=2)
    
    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 {
    		_, err := tencentcloud.GetCamPolicies(ctx, &tencentcloud.GetCamPoliciesArgs{
    			Name:       pulumi.StringRef("tf-example"),
    			PolicyId:   pulumi.StringRef("236215899"),
    			Type:       pulumi.Float64Ref(1),
    			CreateMode: pulumi.Float64Ref(2),
    		}, 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(() => 
    {
        var example = Tencentcloud.GetCamPolicies.Invoke(new()
        {
            Name = "tf-example",
            PolicyId = "236215899",
            Type = 1,
            CreateMode = 2,
        });
    
    });
    
    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.GetCamPoliciesArgs;
    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) {
            final var example = TencentcloudFunctions.getCamPolicies(GetCamPoliciesArgs.builder()
                .name("tf-example")
                .policyId("236215899")
                .type(1)
                .createMode(2)
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: tencentcloud:getCamPolicies
          arguments:
            name: tf-example
            policyId: '236215899'
            type: 1
            createMode: 2
    

    Using getCamPolicies

    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 getCamPolicies(args: GetCamPoliciesArgs, opts?: InvokeOptions): Promise<GetCamPoliciesResult>
    function getCamPoliciesOutput(args: GetCamPoliciesOutputArgs, opts?: InvokeOptions): Output<GetCamPoliciesResult>
    def get_cam_policies(create_mode: Optional[float] = None,
                         description: Optional[str] = None,
                         id: Optional[str] = None,
                         key_word: Optional[str] = None,
                         name: Optional[str] = None,
                         policy_id: Optional[str] = None,
                         result_output_file: Optional[str] = None,
                         scope: Optional[str] = None,
                         type: Optional[float] = None,
                         opts: Optional[InvokeOptions] = None) -> GetCamPoliciesResult
    def get_cam_policies_output(create_mode: pulumi.Input[Optional[float]] = None,
                         description: pulumi.Input[Optional[str]] = None,
                         id: pulumi.Input[Optional[str]] = None,
                         key_word: pulumi.Input[Optional[str]] = None,
                         name: pulumi.Input[Optional[str]] = None,
                         policy_id: pulumi.Input[Optional[str]] = None,
                         result_output_file: pulumi.Input[Optional[str]] = None,
                         scope: pulumi.Input[Optional[str]] = None,
                         type: pulumi.Input[Optional[float]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetCamPoliciesResult]
    func GetCamPolicies(ctx *Context, args *GetCamPoliciesArgs, opts ...InvokeOption) (*GetCamPoliciesResult, error)
    func GetCamPoliciesOutput(ctx *Context, args *GetCamPoliciesOutputArgs, opts ...InvokeOption) GetCamPoliciesResultOutput

    > Note: This function is named GetCamPolicies in the Go SDK.

    public static class GetCamPolicies 
    {
        public static Task<GetCamPoliciesResult> InvokeAsync(GetCamPoliciesArgs args, InvokeOptions? opts = null)
        public static Output<GetCamPoliciesResult> Invoke(GetCamPoliciesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetCamPoliciesResult> getCamPolicies(GetCamPoliciesArgs args, InvokeOptions options)
    public static Output<GetCamPoliciesResult> getCamPolicies(GetCamPoliciesArgs args, InvokeOptions options)
    
    fn::invoke:
      function: tencentcloud:index/getCamPolicies:getCamPolicies
      arguments:
        # arguments dictionary

    The following arguments are supported:

    CreateMode double
    Mode of creation of policy strategy. Valid values: 1, 2. 1 means policy was created with console, and 2 means it was created by strategies.
    Description string
    The description of the CAM policy.
    Id string
    KeyWord string
    Match by strategy name.
    Name string
    Name of the CAM policy to be queried.
    PolicyId string
    ID of CAM policy to be queried.
    ResultOutputFile string
    Used to save results.
    Scope string
    Available values are 'All', 'QCS', and' Local '.' All 'retrieves all policies,' QCS' retrieves preset policies, 'Local' retrieves custom policies, and defaults to 'All'.
    Type double
    Type of the policy strategy. Valid values: 1, 2. 1 means customer strategy and 2 means preset strategy.
    CreateMode float64
    Mode of creation of policy strategy. Valid values: 1, 2. 1 means policy was created with console, and 2 means it was created by strategies.
    Description string
    The description of the CAM policy.
    Id string
    KeyWord string
    Match by strategy name.
    Name string
    Name of the CAM policy to be queried.
    PolicyId string
    ID of CAM policy to be queried.
    ResultOutputFile string
    Used to save results.
    Scope string
    Available values are 'All', 'QCS', and' Local '.' All 'retrieves all policies,' QCS' retrieves preset policies, 'Local' retrieves custom policies, and defaults to 'All'.
    Type float64
    Type of the policy strategy. Valid values: 1, 2. 1 means customer strategy and 2 means preset strategy.
    createMode Double
    Mode of creation of policy strategy. Valid values: 1, 2. 1 means policy was created with console, and 2 means it was created by strategies.
    description String
    The description of the CAM policy.
    id String
    keyWord String
    Match by strategy name.
    name String
    Name of the CAM policy to be queried.
    policyId String
    ID of CAM policy to be queried.
    resultOutputFile String
    Used to save results.
    scope String
    Available values are 'All', 'QCS', and' Local '.' All 'retrieves all policies,' QCS' retrieves preset policies, 'Local' retrieves custom policies, and defaults to 'All'.
    type Double
    Type of the policy strategy. Valid values: 1, 2. 1 means customer strategy and 2 means preset strategy.
    createMode number
    Mode of creation of policy strategy. Valid values: 1, 2. 1 means policy was created with console, and 2 means it was created by strategies.
    description string
    The description of the CAM policy.
    id string
    keyWord string
    Match by strategy name.
    name string
    Name of the CAM policy to be queried.
    policyId string
    ID of CAM policy to be queried.
    resultOutputFile string
    Used to save results.
    scope string
    Available values are 'All', 'QCS', and' Local '.' All 'retrieves all policies,' QCS' retrieves preset policies, 'Local' retrieves custom policies, and defaults to 'All'.
    type number
    Type of the policy strategy. Valid values: 1, 2. 1 means customer strategy and 2 means preset strategy.
    create_mode float
    Mode of creation of policy strategy. Valid values: 1, 2. 1 means policy was created with console, and 2 means it was created by strategies.
    description str
    The description of the CAM policy.
    id str
    key_word str
    Match by strategy name.
    name str
    Name of the CAM policy to be queried.
    policy_id str
    ID of CAM policy to be queried.
    result_output_file str
    Used to save results.
    scope str
    Available values are 'All', 'QCS', and' Local '.' All 'retrieves all policies,' QCS' retrieves preset policies, 'Local' retrieves custom policies, and defaults to 'All'.
    type float
    Type of the policy strategy. Valid values: 1, 2. 1 means customer strategy and 2 means preset strategy.
    createMode Number
    Mode of creation of policy strategy. Valid values: 1, 2. 1 means policy was created with console, and 2 means it was created by strategies.
    description String
    The description of the CAM policy.
    id String
    keyWord String
    Match by strategy name.
    name String
    Name of the CAM policy to be queried.
    policyId String
    ID of CAM policy to be queried.
    resultOutputFile String
    Used to save results.
    scope String
    Available values are 'All', 'QCS', and' Local '.' All 'retrieves all policies,' QCS' retrieves preset policies, 'Local' retrieves custom policies, and defaults to 'All'.
    type Number
    Type of the policy strategy. Valid values: 1, 2. 1 means customer strategy and 2 means preset strategy.

    getCamPolicies Result

    The following output properties are available:

    Id string
    PolicyLists List<GetCamPoliciesPolicyList>
    A list of CAM policies. Each element contains the following attributes:
    CreateMode double
    Mode of creation of policy strategy. 1 means policy was created with console, and 2 means it was created by strategies.
    Description string
    Description of CAM policy.
    KeyWord string
    Name string
    Name of CAM policy.
    PolicyId string
    ID of the policy strategy.
    ResultOutputFile string
    Scope string
    Type double
    Type of the policy strategy. 1 means customer strategy and 2 means preset strategy.
    Id string
    PolicyLists []GetCamPoliciesPolicyList
    A list of CAM policies. Each element contains the following attributes:
    CreateMode float64
    Mode of creation of policy strategy. 1 means policy was created with console, and 2 means it was created by strategies.
    Description string
    Description of CAM policy.
    KeyWord string
    Name string
    Name of CAM policy.
    PolicyId string
    ID of the policy strategy.
    ResultOutputFile string
    Scope string
    Type float64
    Type of the policy strategy. 1 means customer strategy and 2 means preset strategy.
    id String
    policyLists List<GetCamPoliciesPolicyList>
    A list of CAM policies. Each element contains the following attributes:
    createMode Double
    Mode of creation of policy strategy. 1 means policy was created with console, and 2 means it was created by strategies.
    description String
    Description of CAM policy.
    keyWord String
    name String
    Name of CAM policy.
    policyId String
    ID of the policy strategy.
    resultOutputFile String
    scope String
    type Double
    Type of the policy strategy. 1 means customer strategy and 2 means preset strategy.
    id string
    policyLists GetCamPoliciesPolicyList[]
    A list of CAM policies. Each element contains the following attributes:
    createMode number
    Mode of creation of policy strategy. 1 means policy was created with console, and 2 means it was created by strategies.
    description string
    Description of CAM policy.
    keyWord string
    name string
    Name of CAM policy.
    policyId string
    ID of the policy strategy.
    resultOutputFile string
    scope string
    type number
    Type of the policy strategy. 1 means customer strategy and 2 means preset strategy.
    id str
    policy_lists Sequence[GetCamPoliciesPolicyList]
    A list of CAM policies. Each element contains the following attributes:
    create_mode float
    Mode of creation of policy strategy. 1 means policy was created with console, and 2 means it was created by strategies.
    description str
    Description of CAM policy.
    key_word str
    name str
    Name of CAM policy.
    policy_id str
    ID of the policy strategy.
    result_output_file str
    scope str
    type float
    Type of the policy strategy. 1 means customer strategy and 2 means preset strategy.
    id String
    policyLists List<Property Map>
    A list of CAM policies. Each element contains the following attributes:
    createMode Number
    Mode of creation of policy strategy. 1 means policy was created with console, and 2 means it was created by strategies.
    description String
    Description of CAM policy.
    keyWord String
    name String
    Name of CAM policy.
    policyId String
    ID of the policy strategy.
    resultOutputFile String
    scope String
    type Number
    Type of the policy strategy. 1 means customer strategy and 2 means preset strategy.

    Supporting Types

    GetCamPoliciesPolicyList

    Attachments double
    Number of attached users.
    CreateMode double
    Mode of creation of policy strategy. Valid values: 1, 2. 1 means policy was created with console, and 2 means it was created by strategies.
    CreateTime string
    Create time of the CAM policy.
    Description string
    The description of the CAM policy.
    Name string
    Name of the CAM policy to be queried.
    PolicyId string
    ID of CAM policy to be queried.
    ServiceType string
    Name of attached products.
    Type double
    Type of the policy strategy. Valid values: 1, 2. 1 means customer strategy and 2 means preset strategy.
    Attachments float64
    Number of attached users.
    CreateMode float64
    Mode of creation of policy strategy. Valid values: 1, 2. 1 means policy was created with console, and 2 means it was created by strategies.
    CreateTime string
    Create time of the CAM policy.
    Description string
    The description of the CAM policy.
    Name string
    Name of the CAM policy to be queried.
    PolicyId string
    ID of CAM policy to be queried.
    ServiceType string
    Name of attached products.
    Type float64
    Type of the policy strategy. Valid values: 1, 2. 1 means customer strategy and 2 means preset strategy.
    attachments Double
    Number of attached users.
    createMode Double
    Mode of creation of policy strategy. Valid values: 1, 2. 1 means policy was created with console, and 2 means it was created by strategies.
    createTime String
    Create time of the CAM policy.
    description String
    The description of the CAM policy.
    name String
    Name of the CAM policy to be queried.
    policyId String
    ID of CAM policy to be queried.
    serviceType String
    Name of attached products.
    type Double
    Type of the policy strategy. Valid values: 1, 2. 1 means customer strategy and 2 means preset strategy.
    attachments number
    Number of attached users.
    createMode number
    Mode of creation of policy strategy. Valid values: 1, 2. 1 means policy was created with console, and 2 means it was created by strategies.
    createTime string
    Create time of the CAM policy.
    description string
    The description of the CAM policy.
    name string
    Name of the CAM policy to be queried.
    policyId string
    ID of CAM policy to be queried.
    serviceType string
    Name of attached products.
    type number
    Type of the policy strategy. Valid values: 1, 2. 1 means customer strategy and 2 means preset strategy.
    attachments float
    Number of attached users.
    create_mode float
    Mode of creation of policy strategy. Valid values: 1, 2. 1 means policy was created with console, and 2 means it was created by strategies.
    create_time str
    Create time of the CAM policy.
    description str
    The description of the CAM policy.
    name str
    Name of the CAM policy to be queried.
    policy_id str
    ID of CAM policy to be queried.
    service_type str
    Name of attached products.
    type float
    Type of the policy strategy. Valid values: 1, 2. 1 means customer strategy and 2 means preset strategy.
    attachments Number
    Number of attached users.
    createMode Number
    Mode of creation of policy strategy. Valid values: 1, 2. 1 means policy was created with console, and 2 means it was created by strategies.
    createTime String
    Create time of the CAM policy.
    description String
    The description of the CAM policy.
    name String
    Name of the CAM policy to be queried.
    policyId String
    ID of CAM policy to be queried.
    serviceType String
    Name of attached products.
    type Number
    Type of the policy strategy. Valid values: 1, 2. 1 means customer strategy and 2 means preset strategy.

    Package Details

    Repository
    tencentcloud tencentcloudstack/terraform-provider-tencentcloud
    License
    Notes
    This Pulumi package is based on the tencentcloud Terraform Provider.
    Viewing docs for tencentcloud 1.82.91
    published on Friday, May 1, 2026 by tencentcloudstack
      Try Pulumi Cloud free. Your team will thank you.