Show / Hide Table of Contents

Class UserPolicyAttachment

Provides a RAM User Policy attachment resource.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
public MyStack()
{
    // Create a RAM User Policy attachment.
    var user = new AliCloud.Ram.User("user", new AliCloud.Ram.UserArgs
    {
        Comments = "yoyoyo",
        DisplayName = "user_display_name",
        Email = "hello.uuu@aaa.com",
        Force = true,
        Mobile = "86-18688888888",
    });
    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.UserPolicyAttachment("attach", new AliCloud.Ram.UserPolicyAttachmentArgs
    {
        PolicyName = policy.Name,
        PolicyType = policy.Type,
        UserName = user.Name,
    });
}

}
Inheritance
System.Object
Resource
CustomResource
UserPolicyAttachment
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 UserPolicyAttachment : CustomResource

Constructors

View Source

UserPolicyAttachment(String, UserPolicyAttachmentArgs, CustomResourceOptions)

Create a UserPolicyAttachment resource with the given unique name, arguments, and options.

Declaration
public UserPolicyAttachment(string name, UserPolicyAttachmentArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

UserPolicyAttachmentArgs 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

UserName

Name of the RAM user. 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> UserName { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, UserPolicyAttachmentState, CustomResourceOptions)

Get an existing UserPolicyAttachment resource's state with the given name, ID, and optional extra properties used to qualify the lookup.

Declaration
public static UserPolicyAttachment Get(string name, Input<string> id, UserPolicyAttachmentState 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.

UserPolicyAttachmentState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
UserPolicyAttachment
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.