use of software.amazon.awssdk.services.secretsmanager.model.PutSecretValueRequest in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class AWSVaultServiceImpl method replaceSecret.
private Uni<Void> replaceSecret(EventBridgeSecret secret) {
LOGGER.debug("Secret '{}' already exists in AWS Vault. Replacing..", secret.getId());
PutSecretValueRequest putSecretValueRequest = PutSecretValueRequest.builder().secretId(secret.getId()).secretString(Json.encode(secret.getValues())).build();
return Uni.createFrom().future(asyncClient.putSecretValue(putSecretValueRequest)).replaceWithVoid().onFailure().retry().withJitter(DEFAULT_JITTER).withBackOff(DEFAULT_BACKOFF).atMost(MAX_RETRIES).onFailure().transform(e -> new VaultException("Could not replace secret '%s' in AWS Vault", e)).invoke(() -> LOGGER.debug("Secret '{}' replaced", secret.getId()));
}
Aggregations