tencentcloud.CamRoleByName
Explore with Pulumi AI
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
- Cam
Role stringBy Name Id - ID of the resource.
- Console
Login bool - Indicates whether the CAM role can login or not.
- Description string
- Description of the CAM role.
- Name string
- Name of CAM role.
- Dictionary<string, string>
- A list of tags used to associate different resources.
- Document string
- Cam
Role stringBy Name Id - ID of the resource.
- Console
Login bool - Indicates whether the CAM role can login or not.
- Description string
- Description of the CAM role.
- Name string
- Name of CAM role.
- map[string]string
- A list of tags used to associate different resources.
- document String
- cam
Role StringBy Name Id - ID of the resource.
- console
Login Boolean - Indicates whether the CAM role can login or not.
- description String
- Description of the CAM role.
- name String
- Name of CAM role.
- Map<String,String>
- A list of tags used to associate different resources.
- document string
- cam
Role stringBy Name Id - ID of the resource.
- console
Login boolean - Indicates whether the CAM role can login or not.
- description string
- Description of the CAM role.
- name string
- Name of CAM role.
- {[key: string]: string}
- A list of tags used to associate different resources.
- document str
- cam_
role_ strby_ name_ id - 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.
- Mapping[str, str]
- A list of tags used to associate different resources.
- document String
- cam
Role StringBy Name Id - ID of the resource.
- console
Login Boolean - Indicates whether the CAM role can login or not.
- description String
- Description of the CAM role.
- name String
- Name of CAM role.
- 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:
- Create
Time string - Create time of the CAM role.
- Id string
- The provider-assigned unique ID for this managed resource.
- Update
Time string - The last update time of the CAM role.
- Create
Time string - Create time of the CAM role.
- Id string
- The provider-assigned unique ID for this managed resource.
- Update
Time string - The last update time of the CAM role.
- create
Time String - Create time of the CAM role.
- id String
- The provider-assigned unique ID for this managed resource.
- update
Time String - The last update time of the CAM role.
- create
Time string - Create time of the CAM role.
- id string
- The provider-assigned unique ID for this managed resource.
- update
Time 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.
- create
Time String - Create time of the CAM role.
- id String
- The provider-assigned unique ID for this managed resource.
- update
Time 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.
- Cam
Role stringBy Name Id - ID of the resource.
- Console
Login bool - Indicates whether the CAM role can login or not.
- Create
Time string - Create time of the CAM role.
- Description string
- Description of the CAM role.
- Document string
- Name string
- Name of CAM role.
- Dictionary<string, string>
- A list of tags used to associate different resources.
- Update
Time string - The last update time of the CAM role.
- Cam
Role stringBy Name Id - ID of the resource.
- Console
Login bool - Indicates whether the CAM role can login or not.
- Create
Time string - Create time of the CAM role.
- Description string
- Description of the CAM role.
- Document string
- Name string
- Name of CAM role.
- map[string]string
- A list of tags used to associate different resources.
- Update
Time string - The last update time of the CAM role.
- cam
Role StringBy Name Id - ID of the resource.
- console
Login Boolean - Indicates whether the CAM role can login or not.
- create
Time String - Create time of the CAM role.
- description String
- Description of the CAM role.
- document String
- name String
- Name of CAM role.
- Map<String,String>
- A list of tags used to associate different resources.
- update
Time String - The last update time of the CAM role.
- cam
Role stringBy Name Id - ID of the resource.
- console
Login boolean - Indicates whether the CAM role can login or not.
- create
Time string - Create time of the CAM role.
- description string
- Description of the CAM role.
- document string
- name string
- Name of CAM role.
- {[key: string]: string}
- A list of tags used to associate different resources.
- update
Time string - The last update time of the CAM role.
- cam_
role_ strby_ name_ id - 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.
- Mapping[str, str]
- A list of tags used to associate different resources.
- update_
time str - The last update time of the CAM role.
- cam
Role StringBy Name Id - ID of the resource.
- console
Login Boolean - Indicates whether the CAM role can login or not.
- create
Time String - Create time of the CAM role.
- description String
- Description of the CAM role.
- document String
- name String
- Name of CAM role.
- Map<String>
- A list of tags used to associate different resources.
- update
Time 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.