use of software.amazon.awssdk.services.secretsmanager.model.DeleteSecretRequest in project aws-doc-sdk-examples by awsdocs.
the class DeleteSecret method deleteSpecificSecret.
// snippet-start:[secretsmanager.java2.delete_secret.main]
public static void deleteSpecificSecret(SecretsManagerClient secretsClient, String secretName) {
try {
DeleteSecretRequest secretRequest = DeleteSecretRequest.builder().secretId(secretName).build();
secretsClient.deleteSecret(secretRequest);
System.out.println(secretName + " is deleted.");
} catch (SecretsManagerException e) {
System.err.println(e.awsErrorDetails().errorMessage());
System.exit(1);
}
}
use of software.amazon.awssdk.services.secretsmanager.model.DeleteSecretRequest in project web3signer by ConsenSys.
the class AwsSecretsManagerUtil method deleteSecret.
public void deleteSecret() {
final DeleteSecretRequest secretRequest = DeleteSecretRequest.builder().secretId(secretName).build();
secretsManagerClient.deleteSecret(secretRequest);
}
Aggregations