@@ -41,7 +41,8 @@ If you're encountering an "API Key Not Found" issue in your Amplify project, fol
41
41
1 . Open the ` backend/backend-config.json ` file.
42
42
2 . Locate any JSON attribute arrays that include ` GraphQLAPIKeyOutput ` .
43
43
3 . Modify the arrays by removing the ` GraphQLAPIKeyOutput ` entry. For example:
44
- - Change this:
44
+ * Change this:
45
+
45
46
``` json
46
47
"attributes" : [
47
48
" GraphQLAPIIdOutput" ,
@@ -50,8 +51,9 @@ If you're encountering an "API Key Not Found" issue in your Amplify project, fol
50
51
]
51
52
```
52
53
53
- - To this:
54
- ``` json
54
+ * To this:
55
+
56
+ ``` ts
55
57
" attributes" : [
56
58
" GraphQLAPIIdOutput" ,
57
59
" GraphQLAPIEndpointOutput"
@@ -62,16 +64,18 @@ If you're encountering an "API Key Not Found" issue in your Amplify project, fol
62
64
63
65
## Step 3: Apply the Changes
64
66
65
- Push the changes to the cloud:
66
- ```sh
67
- amplify push -y
68
- ```
69
- Once this process is complete, the API key should be removed from both the application and the associated Lambda functions.
67
+ 1 . Push the changes to the cloud:
68
+
69
+ ``` sh
70
+ amplify push -y
71
+ ```
72
+ Once this process is complete, the API key should be removed from both the application and the associated Lambda functions.
70
73
71
74
## Step 4: Restore the API Key
72
75
73
- 1 . Remove the CreateAPIKey: 0 entry from api/[ name] /parameters.json.
76
+ 1 . Remove the ` CreateAPIKey: 0 ` entry from ` api/[name]/parameters.json ` .
74
77
2 . Push the changes to restore the API key to the application:
78
+
75
79
``` sh
76
80
amplify push -y
77
81
```
@@ -81,16 +85,19 @@ If you're encountering an "API Key Not Found" issue in your Amplify project, fol
81
85
## Step 5: Update Lambda Function Resources
82
86
83
87
1 . Use the following command to update each Lambda function that was previously associated with the API:
84
- ```sh
85
- amplify update function
86
- ```
88
+
89
+ ``` sh
90
+ amplify update function
91
+ ```
87
92
2 . Follow the prompts to remove the API from the Lambda’s resources.
88
93
3 . Use the same command to restore the API to each Lambda function:
89
- ``` sh
90
- amplify update function
91
- ```
94
+
95
+ ``` sh
96
+ amplify update function
97
+ ```
92
98
4 . Finally, push the changes to apply them:
93
- ``` sh
94
- amplify push -y
99
+
100
+ ``` sh
101
+ amplify push -y
95
102
```
96
- This should complete the process and resolve the "API Key Not Found" issue.
103
+ This should complete the process and resolve the "API Key Not Found" issue.
0 commit comments