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

tencentcloud.CamRoleByName

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 role.

    Example Usage

    Create normally

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const foo = new tencentcloud.CamRoleByName("foo", {
        consoleLogin: true,
        description: "test",
        document: `{
      "version": "2.0",
      "statement": [
        {
          "action": ["name/sts:AssumeRole"],
          "effect": "allow",
          "principal": {
            "qcs": ["qcs::cam::uin/<your-account-id>:uin/<your-account-id>"]
          }
        }
      ]
    }
    
    `,
        tags: {
            test: "tf-cam-role",
        },
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    foo = tencentcloud.CamRoleByName("foo",
        console_login=True,
        description="test",
        document="""{
      "version": "2.0",
      "statement": [
        {
          "action": ["name/sts:AssumeRole"],
          "effect": "allow",
          "principal": {
            "qcs": ["qcs::cam::uin/<your-account-id>:uin/<your-account-id>"]
          }
        }
      ]
    }
    
    """,
        tags={
            "test": "tf-cam-role",
        })
    
    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.NewCamRoleByName(ctx, "foo", &tencentcloud.CamRoleByNameArgs{
    			ConsoleLogin: pulumi.Bool(true),
    			Description:  pulumi.String("test"),
    			Document: pulumi.String(`{
      "version": "2.0",
      "statement": [
        {
          "action": ["name/sts:AssumeRole"],
          "effect": "allow",
          "principal": {
            "qcs": ["qcs::cam::uin/<your-account-id>:uin/<your-account-id>"]
          }
        }
      ]
    }
    
    `),
    			Tags: pulumi.StringMap{
    				"test": pulumi.String("tf-cam-role"),
    			},
    		})
    		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.CamRoleByName("foo", new()
        {
            ConsoleLogin = true,
            Description = "test",
            Document = @"{
      ""version"": ""2.0"",
      ""statement"": [
        {
          ""action"": [""name/sts:AssumeRole""],
          ""effect"": ""allow"",
          ""principal"": {
            ""qcs"": [""qcs::cam::uin/<your-account-id>:uin/<your-account-id>""]
          }
        }
      ]
    }
    
    ",
            Tags = 
            {
                { "test", "tf-cam-role" },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.CamRoleByName;
    import com.pulumi.tencentcloud.CamRoleByNameArgs;
    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 CamRoleByName("foo", CamRoleByNameArgs.builder()
                .consoleLogin(true)
                .description("test")
                .document("""
    {
      "version": "2.0",
      "statement": [
        {
          "action": ["name/sts:AssumeRole"],
          "effect": "allow",
          "principal": {
            "qcs": ["qcs::cam::uin/<your-account-id>:uin/<your-account-id>"]
          }
        }
      ]
    }
    
                """)
                .tags(Map.of("test", "tf-cam-role"))
                .build());
    
        }
    }
    
    resources:
      foo:
        type: tencentcloud:CamRoleByName
        properties:
          consoleLogin: true
          description: test
          document: |+
            {
              "version": "2.0",
              "statement": [
                {
                  "action": ["name/sts:AssumeRole"],
                  "effect": "allow",
                  "principal": {
                    "qcs": ["qcs::cam::uin/<your-account-id>:uin/<your-account-id>"]
                  }
                }
              ]
            }        
    
          tags:
            test: tf-cam-role
    

    Create with SAML provider

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const boo = new tencentcloud.CamRoleByName("boo", {
        consoleLogin: true,
        description: "test",
        document: `{
      "version": "2.0",
      "statement": [
        {
          "action": ["name/sts:AssumeRole", "name/sts:AssumeRoleWithWebIdentity"],
          "effect": "allow",
          "principal": {
            "federated": ["qcs::cam::uin/<your-account-id>:saml-provider/<your-name>"]
          }
        }
      ]
    }
    
    `,
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    boo = tencentcloud.CamRoleByName("boo",
        console_login=True,
        description="test",
        document="""{
      "version": "2.0",
      "statement": [
        {
          "action": ["name/sts:AssumeRole", "name/sts:AssumeRoleWithWebIdentity"],
          "effect": "allow",
          "principal": {
            "federated": ["qcs::cam::uin/<your-account-id>:saml-provider/<your-name>"]
          }
        }
      ]
    }
    
    """)
    
    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.NewCamRoleByName(ctx, "boo", &tencentcloud.CamRoleByNameArgs{
    			ConsoleLogin: pulumi.Bool(true),
    			Description:  pulumi.String("test"),
    			Document: pulumi.String(`{
      "version": "2.0",
      "statement": [
        {
          "action": ["name/sts:AssumeRole", "name/sts:AssumeRoleWithWebIdentity"],
          "effect": "allow",
          "principal": {
            "federated": ["qcs::cam::uin/<your-account-id>:saml-provider/<your-name>"]
          }
        }
      ]
    }
    
    `),
    		})
    		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 boo = new Tencentcloud.CamRoleByName("boo", new()
        {
            ConsoleLogin = true,
            Description = "test",
            Document = @"{
      ""version"": ""2.0"",
      ""statement"": [
        {
          ""action"": [""name/sts:AssumeRole"", ""name/sts:AssumeRoleWithWebIdentity""],
          ""effect"": ""allow"",
          ""principal"": {
            ""federated"": [""qcs::cam::uin/<your-account-id>:saml-provider/<your-name>""]
          }
        }
      ]
    }
    
    ",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.CamRoleByName;
    import com.pulumi.tencentcloud.CamRoleByNameArgs;
    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 boo = new CamRoleByName("boo", CamRoleByNameArgs.builder()
                .consoleLogin(true)
                .description("test")
                .document("""
    {
      "version": "2.0",
      "statement": [
        {
          "action": ["name/sts:AssumeRole", "name/sts:AssumeRoleWithWebIdentity"],
          "effect": "allow",
          "principal": {
            "federated": ["qcs::cam::uin/<your-account-id>:saml-provider/<your-name>"]
          }
        }
      ]
    }
    
                """)
                .build());
    
        }
    }
    
    resources:
      boo:
        type: tencentcloud:CamRoleByName
        properties:
          consoleLogin: true
          description: test
          document: |+
            {
              "version": "2.0",
              "statement": [
                {
                  "action": ["name/sts:AssumeRole", "name/sts:AssumeRoleWithWebIdentity"],
                  "effect": "allow",
                  "principal": {
                    "federated": ["qcs::cam::uin/<your-account-id>:saml-provider/<your-name>"]
                  }
                }
              ]
            }        
    

    Create CamRoleByName Resource

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

    Constructor syntax

    new CamRoleByName(name: string, args: CamRoleByNameArgs, opts?: CustomResourceOptions);
    @overload
    def CamRoleByName(resource_name: str,
                      args: CamRoleByNameArgs,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def CamRoleByName(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      document: Optional[str] = None,
                      cam_role_by_name_id: Optional[str] = None,
                      console_login: Optional[bool] = None,
                      description: Optional[str] = None,
                      name: Optional[str] = None,
                      tags: Optional[Mapping[str, str]] = None)
    func NewCamRoleByName(ctx *Context, name string, args CamRoleByNameArgs, opts ...ResourceOption) (*CamRoleByName, error)
    public CamRoleByName(string name, CamRoleByNameArgs args, CustomResourceOptions? opts = null)
    public CamRoleByName(String name, CamRoleByNameArgs args)
    public CamRoleByName(String name, CamRoleByNameArgs args, CustomResourceOptions options)
    
    type: tencentcloud:CamRoleByName
    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 CamRoleByNameArgs
    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 CamRoleByNameArgs
    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 CamRoleByNameArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CamRoleByNameArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CamRoleByNameArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    CamRoleByName 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 CamRoleByName resource accepts the following input properties:

    Document string
    CamRoleByNameId string
    ID of the resource.
    ConsoleLogin bool
    Indicates whether the CAM role can login or not.
    Description string
    Description of the CAM role.
    Name string
    Name of CAM role.
    Tags Dictionary<string, string>
    A list of tags used to associate different resources.
    Document string
    CamRoleByNameId string
    ID of the resource.
    ConsoleLogin bool
    Indicates whether the CAM role can login or not.
    Description string
    Description of the CAM role.
    Name string
    Name of CAM role.
    Tags map[string]string
    A list of tags used to associate different resources.
    document String
    camRoleByNameId String
    ID of the resource.
    consoleLogin Boolean
    Indicates whether the CAM role can login or not.
    description String
    Description of the CAM role.
    name String
    Name of CAM role.
    tags Map<String,String>
    A list of tags used to associate different resources.
    document string
    camRoleByNameId string
    ID of the resource.
    consoleLogin boolean
    Indicates whether the CAM role can login or not.
    description string
    Description of the CAM role.
    name string
    Name of CAM role.
    tags {[key: string]: string}
    A list of tags used to associate different resources.
    document str
    cam_role_by_name_id str
    ID of the resource.
    console_login bool
    Indicates whether the CAM role can login or not.
    description str
    Description of the CAM role.
    name str
    Name of CAM role.
    tags Mapping[str, str]
    A list of tags used to associate different resources.
    document String
    camRoleByNameId String
    ID of the resource.
    consoleLogin Boolean
    Indicates whether the CAM role can login or not.
    description String
    Description of the CAM role.
    name String
    Name of CAM role.
    tags Map<String>
    A list of tags used to associate different resources.

    Outputs

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

    CreateTime string
    Create time of the CAM role.
    Id string
    The provider-assigned unique ID for this managed resource.
    UpdateTime string
    The last update time of the CAM role.
    CreateTime string
    Create time of the CAM role.
    Id string
    The provider-assigned unique ID for this managed resource.
    UpdateTime string
    The last update time of the CAM role.
    createTime String
    Create time of the CAM role.
    id String
    The provider-assigned unique ID for this managed resource.
    updateTime String
    The last update time of the CAM role.
    createTime string
    Create time of the CAM role.
    id string
    The provider-assigned unique ID for this managed resource.
    updateTime string
    The last update time of the CAM role.
    create_time str
    Create time of the CAM role.
    id str
    The provider-assigned unique ID for this managed resource.
    update_time str
    The last update time of the CAM role.
    createTime String
    Create time of the CAM role.
    id String
    The provider-assigned unique ID for this managed resource.
    updateTime String
    The last update time of the CAM role.

    Look up Existing CamRoleByName Resource

    Get an existing CamRoleByName 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?: CamRoleByNameState, opts?: CustomResourceOptions): CamRoleByName
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cam_role_by_name_id: Optional[str] = None,
            console_login: Optional[bool] = None,
            create_time: Optional[str] = None,
            description: Optional[str] = None,
            document: Optional[str] = None,
            name: Optional[str] = None,
            tags: Optional[Mapping[str, str]] = None,
            update_time: Optional[str] = None) -> CamRoleByName
    func GetCamRoleByName(ctx *Context, name string, id IDInput, state *CamRoleByNameState, opts ...ResourceOption) (*CamRoleByName, error)
    public static CamRoleByName Get(string name, Input<string> id, CamRoleByNameState? state, CustomResourceOptions? opts = null)
    public static CamRoleByName get(String name, Output<String> id, CamRoleByNameState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:CamRoleByName    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:
    CamRoleByNameId string
    ID of the resource.
    ConsoleLogin bool
    Indicates whether the CAM role can login or not.
    CreateTime string
    Create time of the CAM role.
    Description string
    Description of the CAM role.
    Document string
    Name string
    Name of CAM role.
    Tags Dictionary<string, string>
    A list of tags used to associate different resources.
    UpdateTime string
    The last update time of the CAM role.
    CamRoleByNameId string
    ID of the resource.
    ConsoleLogin bool
    Indicates whether the CAM role can login or not.
    CreateTime string
    Create time of the CAM role.
    Description string
    Description of the CAM role.
    Document string
    Name string
    Name of CAM role.
    Tags map[string]string
    A list of tags used to associate different resources.
    UpdateTime string
    The last update time of the CAM role.
    camRoleByNameId String
    ID of the resource.
    consoleLogin Boolean
    Indicates whether the CAM role can login or not.
    createTime String
    Create time of the CAM role.
    description String
    Description of the CAM role.
    document String
    name String
    Name of CAM role.
    tags Map<String,String>
    A list of tags used to associate different resources.
    updateTime String
    The last update time of the CAM role.
    camRoleByNameId string
    ID of the resource.
    consoleLogin boolean
    Indicates whether the CAM role can login or not.
    createTime string
    Create time of the CAM role.
    description string
    Description of the CAM role.
    document string
    name string
    Name of CAM role.
    tags {[key: string]: string}
    A list of tags used to associate different resources.
    updateTime string
    The last update time of the CAM role.
    cam_role_by_name_id str
    ID of the resource.
    console_login bool
    Indicates whether the CAM role can login or not.
    create_time str
    Create time of the CAM role.
    description str
    Description of the CAM role.
    document str
    name str
    Name of CAM role.
    tags Mapping[str, str]
    A list of tags used to associate different resources.
    update_time str
    The last update time of the CAM role.
    camRoleByNameId String
    ID of the resource.
    consoleLogin Boolean
    Indicates whether the CAM role can login or not.
    createTime String
    Create time of the CAM role.
    description String
    Description of the CAM role.
    document String
    name String
    Name of CAM role.
    tags Map<String>
    A list of tags used to associate different resources.
    updateTime String
    The last update time of the CAM role.

    Import

    CAM role can be imported using the name, e.g.

    $ pulumi import tencentcloud:index/camRoleByName:CamRoleByName foo cam-role-test
    

    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