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