use of software.amazon.awssdk.services.iam.model.UpdateServerCertificateRequest in project aws-doc-sdk-examples by awsdocs.
the class UpdateServerCertificate method updateCertificate.
// snippet-start:[iam.java2.update_server_certificate.main]
public static void updateCertificate(IamClient iam, String curName, String newName) {
try {
UpdateServerCertificateRequest request = UpdateServerCertificateRequest.builder().serverCertificateName(curName).newServerCertificateName(newName).build();
UpdateServerCertificateResponse response = iam.updateServerCertificate(request);
System.out.printf("Successfully updated server certificate to name %s", newName);
} catch (IamException e) {
System.err.println(e.awsErrorDetails().errorMessage());
System.exit(1);
}
}
Aggregations