How to create a new user in AWS

可紊 提交于 2019-12-04 05:35:11
CreateUserRequest user = new CreateUserRequest("userName");

CreateAccessKeyRequest key = new CreateAccessKeyRequest();

BasicAWSCredentials cred = new BasicAWSCredentials("access", "secret");

key.withUserName(user.getUserName());
key.setRequestCredentials(cred);

user.setRequestCredentials(key.getRequestCredentials());
user.setPath("/");
AmazonIdentityManagementClient client =  new AmazonIdentityManagementClient(cred);
CreateUserResult result = client.createUser(user);

Maybe this link can help you :

http://docs.amazonwebservices.com/IAM/latest/APIReference/API_CreateUser.html

I've not played with Amazon S3 service, but with another service like it and I had to create the Request manually and sign the request with correct data.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!