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

tencentcloud.CamPolicy

Explore with Pulumi AI

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

    Provides a resource to create a CAM policy.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const foo = new tencentcloud.CamPolicy("foo", {
        description: "tf_test",
        document: `{
      "version": "2.0",
      "statement": [
        {
          "action": [
            "name/sts:AssumeRole"
          ],
          "effect": "allow",
          "resource": [
            "*"
          ]
        }
      ]
    }
    
    `,
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    foo = tencentcloud.CamPolicy("foo",
        description="tf_test",
        document="""{
      "version": "2.0",
      "statement": [
        {
          "action": [
            "name/sts:AssumeRole"
          ],
          "effect": "allow",
          "resource": [
            "*"
          ]
        }
      ]
    }
    
    """)
    
    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.NewCamPolicy(ctx, "foo", &tencentcloud.CamPolicyArgs{
    			Description: pulumi.String("tf_test"),
    			Document: pulumi.String(`{
      "version": "2.0",
      "statement": [
        {
          "action": [
            "name/sts:AssumeRole"
          ],
          "effect": "allow",
          "resource": [
            "*"
          ]
        }
      ]
    }
    
    `),
    		})
    		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 = new Tencentcloud.CamPolicy("foo", new()
        {
            Description = "tf_test",
            Document = @"{
      ""version"": ""2.0"",
      ""statement"": [
        {
          ""action"": [
            ""name/sts:AssumeRole""
          ],
          ""effect"": ""allow"",
          ""resource"": [
            ""*""
          ]
        }
      ]
    }
    
    ",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.CamPolicy;
    import com.pulumi.tencentcloud.CamPolicyArgs;
    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) {
            var foo = new CamPolicy("foo", CamPolicyArgs.builder()
                .description("tf_test")
                .document("""
    {
      "version": "2.0",
      "statement": [
        {
          "action": [
            "name/sts:AssumeRole"
          ],
          "effect": "allow",
          "resource": [
            "*"
          ]
        }
      ]
    }
    
                """)
                .build());
    
        }
    }
    
    resources:
      foo:
        type: tencentcloud:CamPolicy
        properties:
          description: tf_test
          document: |+
            {
              "version": "2.0",
              "statement": [
                {
                  "action": [
                    "name/sts:AssumeRole"
                  ],
                  "effect": "allow",
                  "resource": [
                    "*"
                  ]
                }
              ]
            }        
    

    Create CamPolicy Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new CamPolicy(name: string, args: CamPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def CamPolicy(resource_name: str,
                  args: CamPolicyArgs,
                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def CamPolicy(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  document: Optional[str] = None,
                  cam_policy_id: Optional[str] = None,
                  description: Optional[str] = None,
                  name: Optional[str] = None)
    func NewCamPolicy(ctx *Context, name string, args CamPolicyArgs, opts ...ResourceOption) (*CamPolicy, error)
    public CamPolicy(string name, CamPolicyArgs args, CustomResourceOptions? opts = null)
    public CamPolicy(String name, CamPolicyArgs args)
    public CamPolicy(String name, CamPolicyArgs args, CustomResourceOptions options)
    
    type: tencentcloud:CamPolicy
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args CamPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args CamPolicyArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args CamPolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CamPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CamPolicyArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    CamPolicy Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The CamPolicy resource accepts the following input properties:

    Document string
    CamPolicyId string
    ID of the resource.
    Description string
    Description of the CAM policy.
    Name string
    Name of CAM policy.
    Document string
    CamPolicyId string
    ID of the resource.
    Description string
    Description of the CAM policy.
    Name string
    Name of CAM policy.
    document String
    camPolicyId String
    ID of the resource.
    description String
    Description of the CAM policy.
    name String
    Name of CAM policy.
    document string
    camPolicyId string
    ID of the resource.
    description string
    Description of the CAM policy.
    name string
    Name of CAM policy.
    document str
    cam_policy_id str
    ID of the resource.
    description str
    Description of the CAM policy.
    name str
    Name of CAM policy.
    document String
    camPolicyId String
    ID of the resource.
    description String
    Description of the CAM policy.
    name String
    Name of CAM policy.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the CamPolicy resource produces the following output properties:

    CreateTime string
    Create time of the CAM policy.
    Id string
    The provider-assigned unique ID for this managed resource.
    Type double
    Type of the policy strategy. Valid values: 1, 2. 1 means customer strategy and 2 means preset strategy.
    UpdateTime string
    The last update time of the CAM policy.
    CreateTime string
    Create time of the CAM policy.
    Id string
    The provider-assigned unique ID for this managed resource.
    Type float64
    Type of the policy strategy. Valid values: 1, 2. 1 means customer strategy and 2 means preset strategy.
    UpdateTime string
    The last update time of the CAM policy.
    createTime String
    Create time of the CAM policy.
    id String
    The provider-assigned unique ID for this managed resource.
    type Double
    Type of the policy strategy. Valid values: 1, 2. 1 means customer strategy and 2 means preset strategy.
    updateTime String
    The last update time of the CAM policy.
    createTime string
    Create time of the CAM policy.
    id string
    The provider-assigned unique ID for this managed resource.
    type number
    Type of the policy strategy. Valid values: 1, 2. 1 means customer strategy and 2 means preset strategy.
    updateTime string
    The last update time of the CAM policy.
    create_time str
    Create time of the CAM policy.
    id str
    The provider-assigned unique ID for this managed resource.
    type float
    Type of the policy strategy. Valid values: 1, 2. 1 means customer strategy and 2 means preset strategy.
    update_time str
    The last update time of the CAM policy.
    createTime String
    Create time of the CAM policy.
    id String
    The provider-assigned unique ID for this managed resource.
    type Number
    Type of the policy strategy. Valid values: 1, 2. 1 means customer strategy and 2 means preset strategy.
    updateTime String
    The last update time of the CAM policy.

    Look up Existing CamPolicy Resource

    Get an existing CamPolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: CamPolicyState, opts?: CustomResourceOptions): CamPolicy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cam_policy_id: Optional[str] = None,
            create_time: Optional[str] = None,
            description: Optional[str] = None,
            document: Optional[str] = None,
            name: Optional[str] = None,
            type: Optional[float] = None,
            update_time: Optional[str] = None) -> CamPolicy
    func GetCamPolicy(ctx *Context, name string, id IDInput, state *CamPolicyState, opts ...ResourceOption) (*CamPolicy, error)
    public static CamPolicy Get(string name, Input<string> id, CamPolicyState? state, CustomResourceOptions? opts = null)
    public static CamPolicy get(String name, Output<String> id, CamPolicyState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:CamPolicy    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    CamPolicyId string
    ID of the resource.
    CreateTime string
    Create time of the CAM policy.
    Description string
    Description of the CAM policy.
    Document string
    Name string
    Name of CAM policy.
    Type double
    Type of the policy strategy. Valid values: 1, 2. 1 means customer strategy and 2 means preset strategy.
    UpdateTime string
    The last update time of the CAM policy.
    CamPolicyId string
    ID of the resource.
    CreateTime string
    Create time of the CAM policy.
    Description string
    Description of the CAM policy.
    Document string
    Name string
    Name of CAM policy.
    Type float64
    Type of the policy strategy. Valid values: 1, 2. 1 means customer strategy and 2 means preset strategy.
    UpdateTime string
    The last update time of the CAM policy.
    camPolicyId String
    ID of the resource.
    createTime String
    Create time of the CAM policy.
    description String
    Description of the CAM policy.
    document String
    name String
    Name of CAM policy.
    type Double
    Type of the policy strategy. Valid values: 1, 2. 1 means customer strategy and 2 means preset strategy.
    updateTime String
    The last update time of the CAM policy.
    camPolicyId string
    ID of the resource.
    createTime string
    Create time of the CAM policy.
    description string
    Description of the CAM policy.
    document string
    name string
    Name of CAM policy.
    type number
    Type of the policy strategy. Valid values: 1, 2. 1 means customer strategy and 2 means preset strategy.
    updateTime string
    The last update time of the CAM policy.
    cam_policy_id str
    ID of the resource.
    create_time str
    Create time of the CAM policy.
    description str
    Description of the CAM policy.
    document str
    name str
    Name of CAM policy.
    type float
    Type of the policy strategy. Valid values: 1, 2. 1 means customer strategy and 2 means preset strategy.
    update_time str
    The last update time of the CAM policy.
    camPolicyId String
    ID of the resource.
    createTime String
    Create time of the CAM policy.
    description String
    Description of the CAM policy.
    document String
    name String
    Name of CAM policy.
    type Number
    Type of the policy strategy. Valid values: 1, 2. 1 means customer strategy and 2 means preset strategy.
    updateTime String
    The last update time of the CAM policy.

    Import

    CAM policy can be imported using the id, e.g.

    $ pulumi import tencentcloud:index/camPolicy:CamPolicy foo 26655801
    

    To learn more about importing existing cloud resources, see Importing resources.

    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