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

}

Coming soon!

import pulumi
import pulumi_alicloud as alicloud

# Create a RAM User Policy attachment.
user = alicloud.ram.User("user",
    comments="yoyoyo",
    display_name="user_display_name",
    email="hello.uuu@aaa.com",
    force=True,
    mobile="86-18688888888")
policy = alicloud.ram.Policy("policy",
    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)
attach = alicloud.ram.UserPolicyAttachment("attach",
    policy_name=policy.name,
    policy_type=policy.type,
    user_name=user.name)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

// Create a RAM User Policy attachment.
const user = new alicloud.ram.User("user", {
    comments: "yoyoyo",
    displayName: "user_display_name",
    email: "hello.uuu@aaa.com",
    force: true,
    mobile: "86-18688888888",
});
const policy = new alicloud.ram.Policy("policy", {
    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,
});
const attach = new alicloud.ram.UserPolicyAttachment("attach", {
    policyName: policy.name,
    policyType: policy.type,
    userName: user.name,
});

Create a UserPolicyAttachment Resource

def UserPolicyAttachment(resource_name, opts=None, policy_name=None, policy_type=None, user_name=None, __props__=None);
name string
The unique name of the resource.
args UserPolicyAttachmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args UserPolicyAttachmentArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args UserPolicyAttachmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

UserPolicyAttachment Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The UserPolicyAttachment resource accepts the following input properties:

PolicyName string

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.

PolicyType string

Type of the RAM policy. It must be Custom or System.

UserName string

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.

PolicyName string

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.

PolicyType string

Type of the RAM policy. It must be Custom or System.

UserName string

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.

policyName string

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.

policyType string

Type of the RAM policy. It must be Custom or System.

userName string

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.

policy_name str

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.

policy_type str

Type of the RAM policy. It must be Custom or System.

user_name str

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.

Outputs

All input properties are implicitly available as output properties. Additionally, the UserPolicyAttachment resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing UserPolicyAttachment Resource

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

static get(resource_name, id, opts=None, policy_name=None, policy_type=None, user_name=None, __props__=None);
func GetUserPolicyAttachment(ctx *Context, name string, id IDInput, state *UserPolicyAttachmentState, opts ...ResourceOption) (*UserPolicyAttachment, error)
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.

The following state arguments are supported:

PolicyName string

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.

PolicyType string

Type of the RAM policy. It must be Custom or System.

UserName string

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.

PolicyName string

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.

PolicyType string

Type of the RAM policy. It must be Custom or System.

UserName string

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.

policyName string

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.

policyType string

Type of the RAM policy. It must be Custom or System.

userName string

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.

policy_name str

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.

policy_type str

Type of the RAM policy. It must be Custom or System.

user_name str

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.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.