Search in sources :

Example 1 with CreateUserRequest

use of com.amazonaws.services.identitymanagement.model.CreateUserRequest in project aws-doc-sdk-examples by awsdocs.

the class CreateUser method main.

public static void main(String[] args) {
    final String USAGE = "To run this example, supply a username\n" + "Ex: CreateUser <username>\n";
    if (args.length != 1) {
        System.out.println(USAGE);
        System.exit(1);
    }
    String username = args[0];
    final AmazonIdentityManagement iam = AmazonIdentityManagementClientBuilder.defaultClient();
    CreateUserRequest request = new CreateUserRequest().withUserName(username);
    CreateUserResult response = iam.createUser(request);
    System.out.println("Successfully created user: " + response.getUser().getUserName());
}
Also used : CreateUserResult(com.amazonaws.services.identitymanagement.model.CreateUserResult) CreateUserRequest(com.amazonaws.services.identitymanagement.model.CreateUserRequest) AmazonIdentityManagement(com.amazonaws.services.identitymanagement.AmazonIdentityManagement)

Aggregations

AmazonIdentityManagement (com.amazonaws.services.identitymanagement.AmazonIdentityManagement)1 CreateUserRequest (com.amazonaws.services.identitymanagement.model.CreateUserRequest)1 CreateUserResult (com.amazonaws.services.identitymanagement.model.CreateUserResult)1