Closed tsrdatatech closed 4 weeks ago
Hi @tsrdatatech - thanks for reaching out and sharing feedback on our docs.
Regarding the code example you provided. It appears that you're invoking the UpdateSecret API within the updateToken function. However, it's important to note that retrieving the current secret value is unnecessary when updating it. Instead, you can simplify your code by following this example:
import {
SecretsManagerClient,
UpdateSecretCommand,
} from "@aws-sdk/client-secrets-manager";
const client = new SecretsManagerClient();
const input = {
// UpdateSecretRequest
SecretId: "secretID", // required
SecretString: ""fasdfaseasef"",
};
const command = new UpdateSecretCommand(input);
const response = await client.send(command);
SecretString
would take in string and is recommended to be in JSON structure "{ \"a\": \"b\" }"
Reference from service API docs:
The text data to encrypt and store in the new version of the secret. We recommend you use a JSON structure of key/value pairs for your secret value.
when someone tries to do something more like updating an actual value then their whole secret is wiped out
Moving on to your comment, I'd appreciate if you could provide more context or clarification. Can you please elaborate further on the specific aspect you need additional information about? This will help me understand your query better and provide a more accurate response.
Best, John
This issue has not received a response in 1 week. If you still think there is a problem, please leave a comment to avoid the issue from automatically closing.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.
Describe the issue
The example here is very basic and simple, when someone tries to do something more like updating an actual value then their whole secret is wiped out if they do not know what they are doing. You should add some real world examples like updating an actual value rather than just the description or something. And outline the steps it takes to do that. For example:
Links
https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/secrets-manager/command/UpdateSecretCommand/