Show / Hide Table of Contents

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,
    });
}

}
Inheritance
System.Object
Resource
CustomResource
RolePolicyAttachment
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.AliCloud.Ram
Assembly: Pulumi.AliCloud.dll
Syntax
public class RolePolicyAttachment : CustomResource

Constructors

View Source

RolePolicyAttachment(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 Source

PolicyName

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>
View Source

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>
View Source

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 Source

Get(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
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.