Search in sources :

Example 1 with CreateAccountAliasRequest

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

the class CreateAccountAlias method main.

public static void main(String[] args) {
    final String USAGE = "To run this example, supply an alias\n" + "Ex: CreateAccountAlias <alias>\n";
    if (args.length != 1) {
        System.out.println(USAGE);
        System.exit(1);
    }
    String alias = args[0];
    final AmazonIdentityManagement iam = AmazonIdentityManagementClientBuilder.defaultClient();
    CreateAccountAliasRequest request = new CreateAccountAliasRequest().withAccountAlias(alias);
    CreateAccountAliasResult response = iam.createAccountAlias(request);
    System.out.println("Successfully created account alias: " + alias);
}
Also used : AmazonIdentityManagement(com.amazonaws.services.identitymanagement.AmazonIdentityManagement) CreateAccountAliasRequest(com.amazonaws.services.identitymanagement.model.CreateAccountAliasRequest) CreateAccountAliasResult(com.amazonaws.services.identitymanagement.model.CreateAccountAliasResult)

Aggregations

AmazonIdentityManagement (com.amazonaws.services.identitymanagement.AmazonIdentityManagement)1 CreateAccountAliasRequest (com.amazonaws.services.identitymanagement.model.CreateAccountAliasRequest)1 CreateAccountAliasResult (com.amazonaws.services.identitymanagement.model.CreateAccountAliasResult)1