Search in sources :

Example 1 with DeleteSecretRequest

use of com.amazonaws.services.secretsmanager.model.DeleteSecretRequest in project datarouter by hotpads.

the class AwsSecretClient method delete.

@Override
public final void delete(String name) {
    var request = new DeleteSecretRequest().withSecretId(name);
    // .withRecoveryWindowInDays(0L);//7-30 days to undelete. default 30
    try {
        try (var $ = TracerTool.startSpan("AWSSecretsManager deleteSecret", TraceSpanGroupType.CLOUD_STORAGE)) {
            TracerTool.appendToSpanInfo(name);
            client.deleteSecret(request);
        }
    } catch (ResourceNotFoundException e) {
        throw new SecretNotFoundException(name, e);
    }
}
Also used : ResourceNotFoundException(com.amazonaws.services.secretsmanager.model.ResourceNotFoundException) SecretNotFoundException(io.datarouter.secret.exception.SecretNotFoundException) DeleteSecretRequest(com.amazonaws.services.secretsmanager.model.DeleteSecretRequest)

Aggregations

DeleteSecretRequest (com.amazonaws.services.secretsmanager.model.DeleteSecretRequest)1 ResourceNotFoundException (com.amazonaws.services.secretsmanager.model.ResourceNotFoundException)1 SecretNotFoundException (io.datarouter.secret.exception.SecretNotFoundException)1