1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. getCamPolicies
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

tencentcloud.getCamPolicies

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

    Use this data source to query detailed information of CAM policies

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const foo = tencentcloud.getCamPolicies({
        policyId: tencentcloud_cam_policy.foo.id,
    });
    const bar = tencentcloud.getCamPolicies({
        policyId: tencentcloud_cam_policy.foo.id,
        name: "tf-auto-test",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    foo = tencentcloud.get_cam_policies(policy_id=tencentcloud_cam_policy["foo"]["id"])
    bar = tencentcloud.get_cam_policies(policy_id=tencentcloud_cam_policy["foo"]["id"],
        name="tf-auto-test")
    
    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{
    			PolicyId: pulumi.StringRef(tencentcloud_cam_policy.Foo.Id),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = tencentcloud.GetCamPolicies(ctx, &tencentcloud.GetCamPoliciesArgs{
    			PolicyId: pulumi.StringRef(tencentcloud_cam_policy.Foo.Id),
    			Name:     pulumi.StringRef("tf-auto-test"),
    		}, 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 foo = Tencentcloud.GetCamPolicies.Invoke(new()
        {
            PolicyId = tencentcloud_cam_policy.Foo.Id,
        });
    
        var bar = Tencentcloud.GetCamPolicies.Invoke(new()
        {
            PolicyId = tencentcloud_cam_policy.Foo.Id,
            Name = "tf-auto-test",
        });
    
    });
    
    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 foo = TencentcloudFunctions.getCamPolicies(GetCamPoliciesArgs.builder()
                .policyId(tencentcloud_cam_policy.foo().id())
                .build());
    
            final var bar = TencentcloudFunctions.getCamPolicies(GetCamPoliciesArgs.builder()
                .policyId(tencentcloud_cam_policy.foo().id())
                .name("tf-auto-test")
                .build());
    
        }
    }
    
    variables:
      foo:
        fn::invoke:
          function: tencentcloud:getCamPolicies
          arguments:
            policyId: ${tencentcloud_cam_policy.foo.id}
      bar:
        fn::invoke:
          function: tencentcloud:getCamPolicies
          arguments:
            policyId: ${tencentcloud_cam_policy.foo.id}
            name: tf-auto-test
    

    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,
                         name: Optional[str] = None,
                         policy_id: Optional[str] = None,
                         result_output_file: Optional[str] = None,
                         type: Optional[float] = None,
                         opts: Optional[InvokeOptions] = None) -> GetCamPoliciesResult
    def get_cam_policies_output(create_mode: Optional[pulumi.Input[float]] = None,
                         description: Optional[pulumi.Input[str]] = None,
                         id: Optional[pulumi.Input[str]] = None,
                         name: Optional[pulumi.Input[str]] = None,
                         policy_id: Optional[pulumi.Input[str]] = None,
                         result_output_file: Optional[pulumi.Input[str]] = None,
                         type: Optional[pulumi.Input[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
    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.
    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
    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.
    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
    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.
    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
    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.
    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
    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.
    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
    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.
    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.
    Name string
    Name of CAM policy.
    PolicyId string
    ID of the policy strategy.
    ResultOutputFile 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.
    Name string
    Name of CAM policy.
    PolicyId string
    ID of the policy strategy.
    ResultOutputFile 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.
    name String
    Name of CAM policy.
    policyId String
    ID of the policy strategy.
    resultOutputFile 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.
    name string
    Name of CAM policy.
    policyId string
    ID of the policy strategy.
    resultOutputFile 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.
    name str
    Name of CAM policy.
    policy_id str
    ID of the policy strategy.
    result_output_file 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.
    name String
    Name of CAM policy.
    policyId String
    ID of the policy strategy.
    resultOutputFile 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.
    tencentcloud logo
    tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack