use of software.amazon.awssdk.services.secretsmanager.model.UpdateSecretRequest in project aws-doc-sdk-examples by awsdocs.
the class UpdateSecret method updateMySecret.
// snippet-start:[secretsmanager.java2.update_secret.main]
public static void updateMySecret(SecretsManagerClient secretsClient, String secretName, String secretValue) {
try {
UpdateSecretRequest secretRequest = UpdateSecretRequest.builder().secretId(secretName).secretString(secretValue).build();
secretsClient.updateSecret(secretRequest);
} catch (SecretsManagerException e) {
System.err.println(e.awsErrorDetails().errorMessage());
System.exit(1);
}
}
use of software.amazon.awssdk.services.secretsmanager.model.UpdateSecretRequest in project cu-kfs by CU-CommunityApps.
the class AwsSecretServiceImpl method updateSecretValue.
@Override
public void updateSecretValue(String awsKeyName, boolean useKfsInstanceNamespace, String keyValue) {
createCacheIfNotPresent();
String fullAwsKey = buildFullAwsKeyName(awsKeyName, useKfsInstanceNamespace);
UpdateSecretRequest updateSecretRequest = UpdateSecretRequest.builder().secretId(fullAwsKey).secretString(keyValue).build();
SecretsManagerClient client = buildSecretsManagerClient();
try {
performUpdate(updateSecretRequest, client);
updateCacheValue(fullAwsKey, keyValue);
} catch (SecretsManagerException e) {
LOG.error("updateSecretValue, had an error setting value for secret " + fullAwsKey, e);
throw new RuntimeException(e);
} finally {
client.close();
}
}
use of software.amazon.awssdk.services.secretsmanager.model.UpdateSecretRequest in project radixdlt by radixdlt.
the class AWSSecretManager method updateMySecret.
private static void updateMySecret(SecretsManagerClient secretsClient, String secretName, String secretValue) {
UpdateSecretRequest secretRequest = UpdateSecretRequest.builder().secretId(secretName).secretString(secretValue).build();
secretsClient.updateSecret(secretRequest);
}
use of software.amazon.awssdk.services.secretsmanager.model.UpdateSecretRequest in project radixdlt by radixdlt.
the class AWSSecretManager method updateMyBinarySecret.
private static void updateMyBinarySecret(SecretsManagerClient secretsClient, String secretName, SdkBytes secretValue) {
UpdateSecretRequest secretRequest = UpdateSecretRequest.builder().secretId(secretName).secretBinary(secretValue).build();
secretsClient.updateSecret(secretRequest);
}
Aggregations