From 90a873ff14d35138fd82352ede9bc95eac07c255 Mon Sep 17 00:00:00 2001 From: Anil Maktala Date: Thu, 22 Aug 2024 11:50:00 -0400 Subject: [PATCH 01/15] Resolving API Key Not Found issue --- .../apikey-not-found/index.mdx | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx diff --git a/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx b/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx new file mode 100644 index 00000000000..f92a8a8ddbf --- /dev/null +++ b/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx @@ -0,0 +1,96 @@ +import { getCustomStaticPath } from '@/utils/getCustomStaticPath'; + +export const meta = { + title: 'Amplify API Key Not Found issue', + description: 'Resolving API Key Not Found issue', + platforms: [ + 'angular', + 'javascript', + 'nextjs', + 'react', + 'react-native', + 'vue' + ] +}; + +export const getStaticPaths = async () => { + return getCustomStaticPath(meta.platforms); +}; + +export function getStaticProps(context) { + return { + props: { + platform: context.params.platform, + meta + } + }; +} + +If you're encountering an "API Key Not Found" issue in your Amplify project, follow the steps below to troubleshoot and resolve the problem: + +## Step 1: Modify `parameters.json` to Remove API Key + 1. Navigate to the api/[name]/parameters.json file in your project. + 2. Add the following line to the file: + ```sh + "CreateAPIKey": 0 + ``` + Ensure that a comma is placed after the previous line if this is added at the end of the JSON object. + +## Step 2: Remove API Key from Lambda Function Attributes + + 1. Open the `backend/backend-config.json` file. + 2. Locate any JSON attribute arrays that include `GraphQLAPIKeyOutput`. + 3. Modify the arrays by removing the `GraphQLAPIKeyOutput` entry. For example: + - Change this: + ```json + "attributes": [ + "GraphQLAPIIdOutput", + "GraphQLAPIEndpointOutput", + "GraphQLAPIKeyOutput" + ] + ``` + + - To this: + ```json + "attributes": [ + "GraphQLAPIIdOutput", + "GraphQLAPIEndpointOutput" + ] + ``` + Perform this change for each Lambda function that utilizes the API. + + +## Step 3: Apply the Changes + + Push the changes to the cloud: + ```sh + amplify push -y + ``` + Once this process is complete, the API key should be removed from both the application and the associated Lambda functions. + +## Step 4: Restore the API Key + + 1. Remove the CreateAPIKey: 0 entry from api/[name]/parameters.json. + 2. Push the changes to restore the API key to the application: + ```sh + amplify push -y + ``` + After this step, the API key should be restored to the application but will not be associated with the Lambda functions. + + +## Step 5: Update Lambda Function Resources + + 1. Use the following command to update each Lambda function that was previously associated with the API: + ```sh + amplify update function + ``` + 2. Follow the prompts to remove the API from the Lambda’s resources. + 3. Use the same command to restore the API to each Lambda function: + ```sh + amplify update function + ``` + 4. Finally, push the changes to apply them: + ```sh + amplify push -y + ``` + This should complete the process and resolve the "API Key Not Found" issue. From de0cfec274fd9459a0cd0e48ef03f6b44a473460 Mon Sep 17 00:00:00 2001 From: Anil Maktala Date: Thu, 22 Aug 2024 11:57:51 -0400 Subject: [PATCH 02/15] updates --- .../apikey-not-found/index.mdx | 43 +++++++++++-------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx b/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx index f92a8a8ddbf..0cdfc3f2699 100644 --- a/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx +++ b/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx @@ -41,7 +41,8 @@ If you're encountering an "API Key Not Found" issue in your Amplify project, fol 1. Open the `backend/backend-config.json` file. 2. Locate any JSON attribute arrays that include `GraphQLAPIKeyOutput`. 3. Modify the arrays by removing the `GraphQLAPIKeyOutput` entry. For example: - - Change this: + * Change this: + ```json "attributes": [ "GraphQLAPIIdOutput", @@ -50,8 +51,9 @@ If you're encountering an "API Key Not Found" issue in your Amplify project, fol ] ``` - - To this: - ```json + * To this: + + ```ts "attributes": [ "GraphQLAPIIdOutput", "GraphQLAPIEndpointOutput" @@ -62,16 +64,18 @@ If you're encountering an "API Key Not Found" issue in your Amplify project, fol ## Step 3: Apply the Changes - Push the changes to the cloud: - ```sh - amplify push -y - ``` - Once this process is complete, the API key should be removed from both the application and the associated Lambda functions. + 1. Push the changes to the cloud: + + ```sh + amplify push -y + ``` + Once this process is complete, the API key should be removed from both the application and the associated Lambda functions. ## Step 4: Restore the API Key - 1. Remove the CreateAPIKey: 0 entry from api/[name]/parameters.json. + 1. Remove the `CreateAPIKey: 0` entry from `api/[name]/parameters.json`. 2. Push the changes to restore the API key to the application: + ```sh amplify push -y ``` @@ -81,16 +85,19 @@ If you're encountering an "API Key Not Found" issue in your Amplify project, fol ## Step 5: Update Lambda Function Resources 1. Use the following command to update each Lambda function that was previously associated with the API: - ```sh - amplify update function - ``` + + ```sh + amplify update function + ``` 2. Follow the prompts to remove the API from the Lambda’s resources. 3. Use the same command to restore the API to each Lambda function: - ```sh - amplify update function - ``` + + ```sh + amplify update function + ``` 4. Finally, push the changes to apply them: - ```sh - amplify push -y + + ```sh + amplify push -y ``` - This should complete the process and resolve the "API Key Not Found" issue. + This should complete the process and resolve the "API Key Not Found" issue. From b23ec5711de5a727cc090fd4829546981495560a Mon Sep 17 00:00:00 2001 From: Anil Maktala Date: Thu, 22 Aug 2024 12:59:06 -0400 Subject: [PATCH 03/15] updated --- .../build-a-backend/troubleshooting/apikey-not-found/index.mdx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx b/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx index 0cdfc3f2699..67a1fca2775 100644 --- a/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx +++ b/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx @@ -31,7 +31,8 @@ If you're encountering an "API Key Not Found" issue in your Amplify project, fol ## Step 1: Modify `parameters.json` to Remove API Key 1. Navigate to the api/[name]/parameters.json file in your project. 2. Add the following line to the file: - ```sh + + ```ts "CreateAPIKey": 0 ``` Ensure that a comma is placed after the previous line if this is added at the end of the JSON object. From c227803d97a4379b9badb33bad0db6eb7c086209 Mon Sep 17 00:00:00 2001 From: Anil Maktala Date: Thu, 22 Aug 2024 13:32:43 -0400 Subject: [PATCH 04/15] added titles --- .../troubleshooting/apikey-not-found/index.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx b/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx index 67a1fca2775..89e1ded6386 100644 --- a/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx +++ b/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx @@ -29,10 +29,10 @@ export function getStaticProps(context) { If you're encountering an "API Key Not Found" issue in your Amplify project, follow the steps below to troubleshoot and resolve the problem: ## Step 1: Modify `parameters.json` to Remove API Key - 1. Navigate to the api/[name]/parameters.json file in your project. + 1. Navigate to the `api/[name]/parameters.json` file in your project. 2. Add the following line to the file: - ```ts + ```ts title="parameters.json" "CreateAPIKey": 0 ``` Ensure that a comma is placed after the previous line if this is added at the end of the JSON object. @@ -44,7 +44,7 @@ If you're encountering an "API Key Not Found" issue in your Amplify project, fol 3. Modify the arrays by removing the `GraphQLAPIKeyOutput` entry. For example: * Change this: - ```json + ```json title="backend-config.json" "attributes": [ "GraphQLAPIIdOutput", "GraphQLAPIEndpointOutput", @@ -54,7 +54,7 @@ If you're encountering an "API Key Not Found" issue in your Amplify project, fol * To this: - ```ts + ```json title="backend-config.json" "attributes": [ "GraphQLAPIIdOutput", "GraphQLAPIEndpointOutput" From c54b7cfabc68d68fcf66140fe949da97ac8813ce Mon Sep 17 00:00:00 2001 From: Anil Maktala Date: Thu, 22 Aug 2024 13:33:40 -0400 Subject: [PATCH 05/15] updated title --- .../build-a-backend/troubleshooting/apikey-not-found/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx b/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx index 89e1ded6386..12f090b4991 100644 --- a/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx +++ b/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx @@ -1,7 +1,7 @@ import { getCustomStaticPath } from '@/utils/getCustomStaticPath'; export const meta = { - title: 'Amplify API Key Not Found issue', + title: 'API Key Not Found issue', description: 'Resolving API Key Not Found issue', platforms: [ 'angular', From 8c4aedbb2066c3a6e1cac1e4a0f5202ac5deb053 Mon Sep 17 00:00:00 2001 From: Anil Maktala Date: Thu, 22 Aug 2024 13:36:15 -0400 Subject: [PATCH 06/15] updated file path --- .../troubleshooting/apikey-not-found/index.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx b/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx index 12f090b4991..7bbd0c2b8be 100644 --- a/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx +++ b/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx @@ -29,7 +29,7 @@ export function getStaticProps(context) { If you're encountering an "API Key Not Found" issue in your Amplify project, follow the steps below to troubleshoot and resolve the problem: ## Step 1: Modify `parameters.json` to Remove API Key - 1. Navigate to the `api/[name]/parameters.json` file in your project. + 1. Navigate to the `amplify/backend/api//parameters.json` file in your project. 2. Add the following line to the file: ```ts title="parameters.json" @@ -39,7 +39,7 @@ If you're encountering an "API Key Not Found" issue in your Amplify project, fol ## Step 2: Remove API Key from Lambda Function Attributes - 1. Open the `backend/backend-config.json` file. + 1. Open the `amplify/backend/backend-config.json` file. 2. Locate any JSON attribute arrays that include `GraphQLAPIKeyOutput`. 3. Modify the arrays by removing the `GraphQLAPIKeyOutput` entry. For example: * Change this: @@ -74,7 +74,7 @@ If you're encountering an "API Key Not Found" issue in your Amplify project, fol ## Step 4: Restore the API Key - 1. Remove the `CreateAPIKey: 0` entry from `api/[name]/parameters.json`. + 1. Remove the `CreateAPIKey: 0` entry from `amplify/backend/api//parameters.json`. 2. Push the changes to restore the API key to the application: ```sh From b2f06314c61d901d39d519b29b9b87467fee9d2a Mon Sep 17 00:00:00 2001 From: Anil Maktala Date: Thu, 22 Aug 2024 13:38:01 -0400 Subject: [PATCH 07/15] fixed styling --- .../troubleshooting/apikey-not-found/index.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx b/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx index 7bbd0c2b8be..4c8302aac3e 100644 --- a/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx +++ b/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx @@ -32,7 +32,7 @@ If you're encountering an "API Key Not Found" issue in your Amplify project, fol 1. Navigate to the `amplify/backend/api//parameters.json` file in your project. 2. Add the following line to the file: - ```ts title="parameters.json" + ```tsx title="parameters.json" "CreateAPIKey": 0 ``` Ensure that a comma is placed after the previous line if this is added at the end of the JSON object. @@ -44,7 +44,7 @@ If you're encountering an "API Key Not Found" issue in your Amplify project, fol 3. Modify the arrays by removing the `GraphQLAPIKeyOutput` entry. For example: * Change this: - ```json title="backend-config.json" + ```tsx title="backend-config.json" "attributes": [ "GraphQLAPIIdOutput", "GraphQLAPIEndpointOutput", @@ -54,7 +54,7 @@ If you're encountering an "API Key Not Found" issue in your Amplify project, fol * To this: - ```json title="backend-config.json" + ```tsx title="backend-config.json" "attributes": [ "GraphQLAPIIdOutput", "GraphQLAPIEndpointOutput" From 1e1edae6e797fa16a28c34d34dc1c51fbaaf4c64 Mon Sep 17 00:00:00 2001 From: Anil Maktala Date: Thu, 22 Aug 2024 13:42:48 -0400 Subject: [PATCH 08/15] fixed styling --- .../apikey-not-found/index.mdx | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx b/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx index 4c8302aac3e..abb58811319 100644 --- a/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx +++ b/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx @@ -29,11 +29,14 @@ export function getStaticProps(context) { If you're encountering an "API Key Not Found" issue in your Amplify project, follow the steps below to troubleshoot and resolve the problem: ## Step 1: Modify `parameters.json` to Remove API Key + 1. Navigate to the `amplify/backend/api//parameters.json` file in your project. 2. Add the following line to the file: ```tsx title="parameters.json" + { "CreateAPIKey": 0 + } ``` Ensure that a comma is placed after the previous line if this is added at the end of the JSON object. @@ -45,20 +48,24 @@ If you're encountering an "API Key Not Found" issue in your Amplify project, fol * Change this: ```tsx title="backend-config.json" - "attributes": [ - "GraphQLAPIIdOutput", - "GraphQLAPIEndpointOutput", - "GraphQLAPIKeyOutput" - ] + { + "attributes": [ + "GraphQLAPIIdOutput", + "GraphQLAPIEndpointOutput", + "GraphQLAPIKeyOutput" + ] + } ``` * To this: ```tsx title="backend-config.json" - "attributes": [ - "GraphQLAPIIdOutput", - "GraphQLAPIEndpointOutput" - ] + { + "attributes": [ + "GraphQLAPIIdOutput", + "GraphQLAPIEndpointOutput" + ] + } ``` Perform this change for each Lambda function that utilizes the API. From b1e10218eca7707f4c1122fc3c46e79cf0c45442 Mon Sep 17 00:00:00 2001 From: Anil Maktala Date: Thu, 22 Aug 2024 16:13:58 -0400 Subject: [PATCH 09/15] aligned text --- .../apikey-not-found/index.mdx | 119 +++++++++--------- 1 file changed, 60 insertions(+), 59 deletions(-) diff --git a/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx b/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx index abb58811319..2591931adc5 100644 --- a/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx +++ b/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx @@ -30,82 +30,83 @@ If you're encountering an "API Key Not Found" issue in your Amplify project, fol ## Step 1: Modify `parameters.json` to Remove API Key - 1. Navigate to the `amplify/backend/api//parameters.json` file in your project. - 2. Add the following line to the file: +1. Navigate to the `amplify/backend/api//parameters.json` file in your project. +2. Add the following line to the file: - ```tsx title="parameters.json" - { - "CreateAPIKey": 0 - } - ``` - Ensure that a comma is placed after the previous line if this is added at the end of the JSON object. + ```json title="parameters.json" + { + "CreateAPIKey": 0 + } + ``` + Ensure that a comma is placed after the previous line if this is added at the end of the JSON object. ## Step 2: Remove API Key from Lambda Function Attributes - 1. Open the `amplify/backend/backend-config.json` file. - 2. Locate any JSON attribute arrays that include `GraphQLAPIKeyOutput`. - 3. Modify the arrays by removing the `GraphQLAPIKeyOutput` entry. For example: - * Change this: - - ```tsx title="backend-config.json" - { - "attributes": [ - "GraphQLAPIIdOutput", - "GraphQLAPIEndpointOutput", - "GraphQLAPIKeyOutput" - ] - } - ``` - - * To this: - - ```tsx title="backend-config.json" - { - "attributes": [ - "GraphQLAPIIdOutput", - "GraphQLAPIEndpointOutput" - ] - } - ``` - Perform this change for each Lambda function that utilizes the API. +1. Open the `amplify/backend/backend-config.json` file. +2. Locate any JSON attribute arrays that include `GraphQLAPIKeyOutput`. +3. Modify the arrays by removing the `GraphQLAPIKeyOutput` entry. For example: + + * Change this: + + ```json title="backend-config.json" + { + "attributes": [ + "GraphQLAPIIdOutput", + "GraphQLAPIEndpointOutput", + "GraphQLAPIKeyOutput" + ] + } + ``` + + * To this: + + ```json title="backend-config.json" + { + "attributes": [ + "GraphQLAPIIdOutput", + "GraphQLAPIEndpointOutput" + ] + } + ``` + Perform this change for each Lambda function that utilizes the API. ## Step 3: Apply the Changes - 1. Push the changes to the cloud: +1. Push the changes to the cloud: - ```sh - amplify push -y - ``` - Once this process is complete, the API key should be removed from both the application and the associated Lambda functions. + ```sh + amplify push -y + ``` + Once this process is complete, the API key should be removed from both the application and the associated Lambda functions. ## Step 4: Restore the API Key - 1. Remove the `CreateAPIKey: 0` entry from `amplify/backend/api//parameters.json`. - 2. Push the changes to restore the API key to the application: +1. Remove the `CreateAPIKey: 0` entry from `amplify/backend/api//parameters.json`. +2. Push the changes to restore the API key to the application: - ```sh - amplify push -y - ``` - After this step, the API key should be restored to the application but will not be associated with the Lambda functions. + ```sh + amplify push -y + ``` + After this step, the API key should be restored to the application but will not be associated with the Lambda functions. ## Step 5: Update Lambda Function Resources - 1. Use the following command to update each Lambda function that was previously associated with the API: +1. Use the following command to update each Lambda function that was previously associated with the API: - ```sh - amplify update function - ``` - 2. Follow the prompts to remove the API from the Lambda’s resources. - 3. Use the same command to restore the API to each Lambda function: + ```sh + amplify update function + ``` +2. Follow the prompts to remove the API from the Lambda’s resources. +3. Use the same command to restore the API to each Lambda function: - ```sh - amplify update function - ``` - 4. Finally, push the changes to apply them: + ```sh + amplify update function + ``` +4. Finally, push the changes to apply them: - ```sh - amplify push -y - ``` - This should complete the process and resolve the "API Key Not Found" issue. + ```sh + amplify push -y + ``` + This should complete the process and resolve the "API Key Not Found" issue. From 6467e16b315d40a1e7e7e87c660b8e8eda31619d Mon Sep 17 00:00:00 2001 From: Anil Maktala Date: Thu, 22 Aug 2024 16:15:12 -0400 Subject: [PATCH 10/15] fixed format --- .../build-a-backend/troubleshooting/apikey-not-found/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx b/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx index 2591931adc5..f02b6ca2e39 100644 --- a/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx +++ b/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx @@ -108,5 +108,5 @@ If you're encountering an "API Key Not Found" issue in your Amplify project, fol ```sh amplify push -y - ``` + ``` This should complete the process and resolve the "API Key Not Found" issue. From 35374bc8374e6e3f1436568d921d4c1db671e22b Mon Sep 17 00:00:00 2001 From: Anil Maktala Date: Thu, 22 Aug 2024 16:16:42 -0400 Subject: [PATCH 11/15] text alignment --- .../apikey-not-found/index.mdx | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx b/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx index f02b6ca2e39..41b000c5c04 100644 --- a/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx +++ b/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx @@ -46,29 +46,29 @@ If you're encountering an "API Key Not Found" issue in your Amplify project, fol 2. Locate any JSON attribute arrays that include `GraphQLAPIKeyOutput`. 3. Modify the arrays by removing the `GraphQLAPIKeyOutput` entry. For example: - * Change this: - - ```json title="backend-config.json" - { - "attributes": [ - "GraphQLAPIIdOutput", - "GraphQLAPIEndpointOutput", - "GraphQLAPIKeyOutput" - ] - } - ``` - - * To this: - - ```json title="backend-config.json" - { - "attributes": [ - "GraphQLAPIIdOutput", - "GraphQLAPIEndpointOutput" - ] - } - ``` - Perform this change for each Lambda function that utilizes the API. + * Change this: + + ```json title="backend-config.json" + { + "attributes": [ + "GraphQLAPIIdOutput", + "GraphQLAPIEndpointOutput", + "GraphQLAPIKeyOutput" + ] + } + ``` + + * To this: + + ```json title="backend-config.json" + { + "attributes": [ + "GraphQLAPIIdOutput", + "GraphQLAPIEndpointOutput" + ] + } + ``` + Perform this change for each Lambda function that utilizes the API. ## Step 3: Apply the Changes From 118ea2eddc69b73602f382fdde2d306443d99cc8 Mon Sep 17 00:00:00 2001 From: Anil Maktala Date: Fri, 23 Aug 2024 15:59:42 -0400 Subject: [PATCH 12/15] updated filepath --- .../troubleshooting/apikey-not-found/index.mdx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx b/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx index 41b000c5c04..ff12abc3b68 100644 --- a/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx +++ b/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx @@ -33,7 +33,7 @@ If you're encountering an "API Key Not Found" issue in your Amplify project, fol 1. Navigate to the `amplify/backend/api//parameters.json` file in your project. 2. Add the following line to the file: - ```json title="parameters.json" + ```json title="amplify/backend/api//parameters.json" { "CreateAPIKey": 0 } @@ -48,7 +48,7 @@ If you're encountering an "API Key Not Found" issue in your Amplify project, fol * Change this: - ```json title="backend-config.json" + ```json title="amplify/backend/backend-config.json" { "attributes": [ "GraphQLAPIIdOutput", @@ -60,7 +60,7 @@ If you're encountering an "API Key Not Found" issue in your Amplify project, fol * To this: - ```json title="backend-config.json" + ```json title="amplify/backend/backend-config.json" { "attributes": [ "GraphQLAPIIdOutput", @@ -75,7 +75,7 @@ If you're encountering an "API Key Not Found" issue in your Amplify project, fol 1. Push the changes to the cloud: - ```sh + ```terminal amplify push -y ``` Once this process is complete, the API key should be removed from both the application and the associated Lambda functions. @@ -85,7 +85,7 @@ If you're encountering an "API Key Not Found" issue in your Amplify project, fol 1. Remove the `CreateAPIKey: 0` entry from `amplify/backend/api//parameters.json`. 2. Push the changes to restore the API key to the application: - ```sh + ```terminal amplify push -y ``` After this step, the API key should be restored to the application but will not be associated with the Lambda functions. @@ -95,18 +95,18 @@ If you're encountering an "API Key Not Found" issue in your Amplify project, fol 1. Use the following command to update each Lambda function that was previously associated with the API: - ```sh + ```terminal amplify update function ``` 2. Follow the prompts to remove the API from the Lambda’s resources. 3. Use the same command to restore the API to each Lambda function: - ```sh + ```terminal amplify update function ``` 4. Finally, push the changes to apply them: - ```sh + ```terminal amplify push -y ``` This should complete the process and resolve the "API Key Not Found" issue. From 80cd2a2d2727afea0eb99ca16d811abfb5842aef Mon Sep 17 00:00:00 2001 From: Anil Maktala Date: Fri, 23 Aug 2024 16:28:45 -0400 Subject: [PATCH 13/15] Update src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx Co-authored-by: josef --- .../build-a-backend/troubleshooting/apikey-not-found/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx b/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx index ff12abc3b68..936fa85a4d6 100644 --- a/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx +++ b/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx @@ -30,7 +30,7 @@ If you're encountering an "API Key Not Found" issue in your Amplify project, fol ## Step 1: Modify `parameters.json` to Remove API Key -1. Navigate to the `amplify/backend/api//parameters.json` file in your project. +1. Navigate to the `amplify/backend/api//parameters.json` file in your project. 2. Add the following line to the file: ```json title="amplify/backend/api//parameters.json" From 3a63f770de00750853391904337ac01f6fbeafe0 Mon Sep 17 00:00:00 2001 From: Anil Maktala Date: Fri, 23 Aug 2024 16:28:54 -0400 Subject: [PATCH 14/15] Update src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx Co-authored-by: josef --- .../build-a-backend/troubleshooting/apikey-not-found/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx b/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx index 936fa85a4d6..34fff7b186b 100644 --- a/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx +++ b/src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx @@ -33,7 +33,7 @@ If you're encountering an "API Key Not Found" issue in your Amplify project, fol 1. Navigate to the `amplify/backend/api//parameters.json` file in your project. 2. Add the following line to the file: - ```json title="amplify/backend/api//parameters.json" + ```json title="amplify/backend/api//parameters.json" { "CreateAPIKey": 0 } From bf5f2cab0a4d2159f63ca7f945ed8214afe4f078 Mon Sep 17 00:00:00 2001 From: Anil Maktala Date: Fri, 30 Aug 2024 08:44:23 -0400 Subject: [PATCH 15/15] added apikey-not-found entry in directory.mjs --- src/directory/directory.mjs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/directory/directory.mjs b/src/directory/directory.mjs index d8bcb643a59..2b887e15313 100644 --- a/src/directory/directory.mjs +++ b/src/directory/directory.mjs @@ -1742,6 +1742,9 @@ export const directory = { }, { path: 'src/pages/gen1/[platform]/build-a-backend/troubleshooting/library-not-configured/index.mdx' + }, + { + path: 'src/pages/gen1/[platform]/build-a-backend/troubleshooting/apikey-not-found/index.mdx' } ] }