tencentcloud.CamPolicyByName
Explore with Pulumi AI
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.CamPolicyByName("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.CamPolicyByName("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.NewCamPolicyByName(ctx, "foo", &tencentcloud.CamPolicyByNameArgs{
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.CamPolicyByName("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.CamPolicyByName;
import com.pulumi.tencentcloud.CamPolicyByNameArgs;
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 CamPolicyByName("foo", CamPolicyByNameArgs.builder()
.description("tf_test")
.document("""
{
"version": "2.0",
"statement": [
{
"action": [
"name/sts:AssumeRole"
],
"effect": "allow",
"resource": [
"*"
]
}
]
}
""")
.build());
}
}
resources:
foo:
type: tencentcloud:CamPolicyByName
properties:
description: tf_test
document: |+
{
"version": "2.0",
"statement": [
{
"action": [
"name/sts:AssumeRole"
],
"effect": "allow",
"resource": [
"*"
]
}
]
}
Create CamPolicyByName Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new CamPolicyByName(name: string, args: CamPolicyByNameArgs, opts?: CustomResourceOptions);
@overload
def CamPolicyByName(resource_name: str,
args: CamPolicyByNameArgs,
opts: Optional[ResourceOptions] = None)
@overload
def CamPolicyByName(resource_name: str,
opts: Optional[ResourceOptions] = None,
document: Optional[str] = None,
cam_policy_by_name_id: Optional[str] = None,
description: Optional[str] = None,
name: Optional[str] = None)
func NewCamPolicyByName(ctx *Context, name string, args CamPolicyByNameArgs, opts ...ResourceOption) (*CamPolicyByName, error)
public CamPolicyByName(string name, CamPolicyByNameArgs args, CustomResourceOptions? opts = null)
public CamPolicyByName(String name, CamPolicyByNameArgs args)
public CamPolicyByName(String name, CamPolicyByNameArgs args, CustomResourceOptions options)
type: tencentcloud:CamPolicyByName
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 CamPolicyByNameArgs
- 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 CamPolicyByNameArgs
- 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 CamPolicyByNameArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CamPolicyByNameArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args CamPolicyByNameArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
CamPolicyByName 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 CamPolicyByName resource accepts the following input properties:
- Document string
- Cam
Policy stringBy Name Id - ID of the resource.
- Description string
- Description of the CAM policy.
- Name string
- Name of CAM policy.
- Document string
- Cam
Policy stringBy Name Id - ID of the resource.
- Description string
- Description of the CAM policy.
- Name string
- Name of CAM policy.
- document String
- cam
Policy StringBy Name Id - ID of the resource.
- description String
- Description of the CAM policy.
- name String
- Name of CAM policy.
- document string
- cam
Policy stringBy Name Id - ID of the resource.
- description string
- Description of the CAM policy.
- name string
- Name of CAM policy.
- document str
- cam_
policy_ strby_ name_ id - ID of the resource.
- description str
- Description of the CAM policy.
- name str
- Name of CAM policy.
- document String
- cam
Policy StringBy Name Id - 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 CamPolicyByName resource produces the following output properties:
- Create
Time 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 and2
means preset strategy. - Update
Time string - The last update time of the CAM policy.
- Create
Time 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 and2
means preset strategy. - Update
Time string - The last update time of the CAM policy.
- create
Time 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 and2
means preset strategy. - update
Time String - The last update time of the CAM policy.
- create
Time 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 and2
means preset strategy. - update
Time 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 and2
means preset strategy. - update_
time str - The last update time of the CAM policy.
- create
Time 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 and2
means preset strategy. - update
Time String - The last update time of the CAM policy.
Look up Existing CamPolicyByName Resource
Get an existing CamPolicyByName 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?: CamPolicyByNameState, opts?: CustomResourceOptions): CamPolicyByName
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
cam_policy_by_name_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) -> CamPolicyByName
func GetCamPolicyByName(ctx *Context, name string, id IDInput, state *CamPolicyByNameState, opts ...ResourceOption) (*CamPolicyByName, error)
public static CamPolicyByName Get(string name, Input<string> id, CamPolicyByNameState? state, CustomResourceOptions? opts = null)
public static CamPolicyByName get(String name, Output<String> id, CamPolicyByNameState state, CustomResourceOptions options)
resources: _: type: tencentcloud:CamPolicyByName 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
Policy stringBy Name Id - ID of the resource.
- Create
Time 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 and2
means preset strategy. - Update
Time string - The last update time of the CAM policy.
- Cam
Policy stringBy Name Id - ID of the resource.
- Create
Time 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 and2
means preset strategy. - Update
Time string - The last update time of the CAM policy.
- cam
Policy StringBy Name Id - ID of the resource.
- create
Time 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 and2
means preset strategy. - update
Time String - The last update time of the CAM policy.
- cam
Policy stringBy Name Id - ID of the resource.
- create
Time 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 and2
means preset strategy. - update
Time string - The last update time of the CAM policy.
- cam_
policy_ strby_ name_ id - 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 and2
means preset strategy. - update_
time str - The last update time of the CAM policy.
- cam
Policy StringBy Name Id - ID of the resource.
- create
Time 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 and2
means preset strategy. - update
Time String - The last update time of the CAM policy.
Import
CAM policy can be imported using the name, e.g.
$ pulumi import tencentcloud:index/camPolicyByName:CamPolicyByName foo name
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.