Class RolePolicyAttachment
Provides a RAM Role attachment resource.
Example Usage
using Pulumi;
using AliCloud = Pulumi.AliCloud;
class MyStack : Stack
{
public MyStack()
{
// Create a RAM Role Policy attachment.
var role = new AliCloud.Ram.Role("role", new AliCloud.Ram.RoleArgs
{
Description = "this is a role test.",
Document = @" {
""Statement"": [
{
""Action"": ""sts:AssumeRole"",
""Effect"": ""Allow"",
""Principal"": {
""Service"": [
""apigateway.aliyuncs.com"",
""ecs.aliyuncs.com""
]
}
}
],
""Version"": ""1""
}
",
Force = true,
});
var policy = new AliCloud.Ram.Policy("policy", new AliCloud.Ram.PolicyArgs
{
Description = "this is a policy test",
Document = @" {
""Statement"": [
{
""Action"": [
""oss:ListObjects"",
""oss:GetObject""
],
""Effect"": ""Allow"",
""Resource"": [
""acs:oss:*:*:mybucket"",
""acs:oss:*:*:mybucket/*""
]
}
],
""Version"": ""1""
}
",
Force = true,
});
var attach = new AliCloud.Ram.RolePolicyAttachment("attach", new AliCloud.Ram.RolePolicyAttachmentArgs
{
PolicyName = policy.Name,
PolicyType = policy.Type,
RoleName = role.Name,
});
}
}
Inherited Members
Namespace: Pulumi.AliCloud.Ram
Assembly: Pulumi.AliCloud.dll
Syntax
public class RolePolicyAttachment : CustomResource
Constructors
View SourceRolePolicyAttachment(String, RolePolicyAttachmentArgs, CustomResourceOptions)
Create a RolePolicyAttachment resource with the given unique name, arguments, and options.
Declaration
public RolePolicyAttachment(string name, RolePolicyAttachmentArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| RolePolicyAttachmentArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourcePolicyName
Name of the RAM policy. This name can have a string of 1 to 128 characters, must contain only alphanumeric characters or hyphen "-", and must not begin with a hyphen.
Declaration
public Output<string> PolicyName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
PolicyType
Type of the RAM policy. It must be Custom or System.
Declaration
public Output<string> PolicyType { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
RoleName
Name of the RAM Role. This name can have a string of 1 to 64 characters, must contain only alphanumeric characters or hyphens, such as "-", "_", and must not begin with a hyphen.
Declaration
public Output<string> RoleName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, RolePolicyAttachmentState, CustomResourceOptions)
Get an existing RolePolicyAttachment resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static RolePolicyAttachment Get(string name, Input<string> id, RolePolicyAttachmentState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| RolePolicyAttachmentState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| RolePolicyAttachment |