UserPolicyAttachmentArgs

data class UserPolicyAttachmentArgs(val policyName: Output<String>? = null, val policyType: Output<String>? = null, val userName: Output<String>? = null) : ConvertibleToJava<UserPolicyAttachmentArgs>

Provides a RAM User Policy attachment resource.

NOTE: Available since v1.0.0.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.ram.User;
import com.pulumi.alicloud.ram.UserArgs;
import com.pulumi.alicloud.ram.Policy;
import com.pulumi.alicloud.ram.PolicyArgs;
import com.pulumi.alicloud.ram.UserPolicyAttachment;
import com.pulumi.alicloud.ram.UserPolicyAttachmentArgs;
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 user = new User("user", UserArgs.builder()
.displayName("user_display_name")
.mobile("86-18688888888")
.email("hello.uuu@aaa.com")
.comments("yoyoyo")
.build());
var policy = new Policy("policy", PolicyArgs.builder()
.document("""
{
"Statement": [
{
"Action": [
"oss:ListObjects",
"oss:GetObject"
],
"Effect": "Allow",
"Resource": [
"acs:oss:*:*:mybucket",
"acs:oss:*:*:mybucket/*"
]
}
],
"Version": "1"
}
""")
.description("this is a policy test")
.build());
var attach = new UserPolicyAttachment("attach", UserPolicyAttachmentArgs.builder()
.policyName(policy.name())
.policyType(policy.type())
.userName(user.name())
.build());
}
}

Import

RAM User Policy attachment can be imported using the id, e.g.

$ pulumi import alicloud:ram/userPolicyAttachment:UserPolicyAttachment example user:my-policy:Custom:my-user

Constructors

Link copied to clipboard
fun UserPolicyAttachmentArgs(policyName: Output<String>? = null, policyType: Output<String>? = null, userName: Output<String>? = null)

Functions

Link copied to clipboard
open override fun toJava(): UserPolicyAttachmentArgs

Properties

Link copied to clipboard
val policyName: Output<String>? = null

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.

Link copied to clipboard
val policyType: Output<String>? = null

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

Link copied to clipboard
val userName: Output<String>? = null

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. */