use of software.amazon.awssdk.services.iam.model.CreateAccountAliasRequest in project aws-doc-sdk-examples by awsdocs.
the class CreateAccountAlias method createIAMAccountAlias.
// snippet-start:[iam.java2.create_account_alias.main]
public static void createIAMAccountAlias(IamClient iam, String alias) {
try {
CreateAccountAliasRequest request = CreateAccountAliasRequest.builder().accountAlias(alias).build();
iam.createAccountAlias(request);
System.out.println("Successfully created account alias: " + alias);
} catch (IamException e) {
System.err.println(e.awsErrorDetails().errorMessage());
System.exit(1);
}
}
Aggregations