From 8d9390e1da7c688a8ed0e0cbdcd297aabfef6c57 Mon Sep 17 00:00:00 2001 From: ykethan Date: Fri, 21 Mar 2025 12:05:31 -0400 Subject: [PATCH] secrets remove all option --- .../sandbox-environments/features/index.mdx | 10 +++++++++- src/pages/[platform]/reference/cli-commands/index.mdx | 8 ++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/pages/[platform]/deploy-and-host/sandbox-environments/features/index.mdx b/src/pages/[platform]/deploy-and-host/sandbox-environments/features/index.mdx index 96d3df09f4d..def0f674872 100644 --- a/src/pages/[platform]/deploy-and-host/sandbox-environments/features/index.mdx +++ b/src/pages/[platform]/deploy-and-host/sandbox-environments/features/index.mdx @@ -86,7 +86,7 @@ value: abc123 lastUpdated: Mon Nov 13 2023 22:19:12 GMT-0800 (Pacific Standard Time) ``` -### Remove secrets +### Remove secret To remove a secret from from the sandbox, run the following command in your terminal: @@ -94,6 +94,14 @@ To remove a secret from from the sandbox, run the following command in your term npx ampx sandbox secret remove foo ``` +### Remove all secrets + +To remove all secrets from the sandbox, run the following command in your terminal: + +```bash +npx ampx sandbox secret remove --all +``` + ### Reference secrets Once you have set a secret, you can reference the secret in your backend definition using the `secret()` function. The following example shows how to set up social sign-in with authentication in your app. Depending on your environment, Amplify will automatically load the correct secret value. diff --git a/src/pages/[platform]/reference/cli-commands/index.mdx b/src/pages/[platform]/reference/cli-commands/index.mdx index baf52bffe07..21339c4f1eb 100644 --- a/src/pages/[platform]/reference/cli-commands/index.mdx +++ b/src/pages/[platform]/reference/cli-commands/index.mdx @@ -169,6 +169,14 @@ If you want to remove a secret you previously set, use `sandbox secret remove`: npx ampx sandbox secret remove LOGINWITHAMAZON_CLIENT_ID ``` +#### Removing all secrets + +If you want to remove all secrets you previously set, use `sandbox secret remove --all`: + +```bash title="Terminal" showLineNumbers={false} +npx ampx sandbox secret remove --all +``` + #### Listing secrets List all available secrets for your personal sandbox in the default AWS profile and Region: