use of com.amazonaws.services.identitymanagement.model.CreateAccessKeyRequest in project aws-doc-sdk-examples by awsdocs.
the class CreateAccessKey method main.
public static void main(String[] args) {
final String USAGE = "To run this example, supply an IAM user\n" + "Ex: CreateAccessKey <user>\n";
if (args.length != 1) {
System.out.println(USAGE);
System.exit(1);
}
String user = args[0];
final AmazonIdentityManagement iam = AmazonIdentityManagementClientBuilder.defaultClient();
CreateAccessKeyRequest request = new CreateAccessKeyRequest().withUserName(user);
CreateAccessKeyResult response = iam.createAccessKey(request);
System.out.println("Created access key: " + response.getAccessKey());
}
Aggregations