Upgrade of Amplify and Migration of REST API
See original GitHub issueBefore opening, please confirm:
- I have searched for duplicate or closed issues and discussions.
- I have read the guide for submitting bug reports.
- I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
JavaScript Framework
React
Amplify APIs
Authentication, REST API
Amplify Categories
auth, function, api
Environment information
System:
OS: Linux 5.13 Ubuntu 21.10 21.10 (Impish Indri)
CPU: (8) x64 AMD Ryzen 5 2400G with Radeon Vega Graphics
Memory: 500.36 MB / 13.60 GB
Container: Yes
Shell: 5.1.8 - /bin/bash
Binaries:
Node: 12.22.7 - ~/.nvm/versions/node/v12.22.7/bin/node
npm: 6.14.15 - ~/.nvm/versions/node/v12.22.7/bin/npm
Browsers:
Chrome: 96.0.4664.93
Firefox: 95.0
npmPackages:
@aws-amplify/auth: ^4.3.12 => 4.3.16
@aws-amplify/ui-components: ^1.9.2 => 1.9.6
@aws-amplify/ui-react: ^1.2.22 => 1.2.26
@emotion/react: ^11.5.0 => 11.7.0
@emotion/styled: ^11.3.0 => 11.6.0
@mui/icons-material: ^5.0.5 => 5.2.0
@mui/material: ^5.0.6 => 5.2.1
@mui/styles: ^5.0.2 => 5.2.1
@react-pdf-viewer/core: ^2.11.0 => 2.11.0
@react-pdf-viewer/page-navigation: ^2.11.0 => 2.11.0
@react-pdf-viewer/search: ^2.11.0 => 2.11.0
@testing-library/jest-dom: ^5.15.0 => 5.15.1
@testing-library/react: ^12.1.2 => 12.1.2
@testing-library/user-event: ^13.5.0 => 13.5.0
@types/enzyme: ^3.10.10 => 3.10.10
@types/jest: ^27.0.2 => 27.0.3
@types/node: ^16.11.6 => 16.11.10
@types/react: ^17.0.33 => 17.0.37
@types/react-dom: ^17.0.10 => 17.0.11
@types/react-tag-input: ^6.1.3 => 6.1.3
@types/uuid: ^8.3.1 => 8.3.3
@wojtekmaj/enzyme-adapter-react-17: ^0.6.5 => 0.6.5
amplify-ui-components-loader: undefined ()
aws-amplify: ^4.3.4 => 4.3.8
classnames: ^2.3.1 => 2.3.1
enzyme: ^3.11.0 => 3.11.0
jszip: ^3.7.1 => 3.7.1
pdfjs-dist: 2.6.347 => 2.6.347
react: ^17.0.2 => 17.0.2
react-dom: ^17.0.2 => 17.0.2
react-hook-form: ^7.19.1 => 7.20.4
react-scripts: 4.0.3 => 4.0.3
typescript: ^4.4.4 => 4.5.2
uuid: ^8.3.2 => 8.3.2 (3.4.0, 3.3.2)
npmGlobalPackages:
npm: 6.14.15
Describe the bug
When I upgraded the CLI to the latest and migrated the REST API. It removed my parameters.json
and search-cloudformation-template.json
. It added cli-inputs.json
. When I ran amplify push
it updated the API successfully.
Any API call to the REST API now returns 403: IncompleteSignatureException. When I test the API through the API Gateway console it works fine.
In the API Gateway I had previously had a Cognito authorizer; but after the update it was removed. I added it back but still get the same 403 error. See the screenshot for what it looks like after I add it back.
Expected behavior
When upgrading the REST API I would like it to not break . If it does break, I’d like to have a process to fix (I currently don’t know how to resolve this).
Reproduction steps
amplify upgrade
amplify update api
amplify push
Code Snippet
// Put your code below this line.
API.post('search', `/search`, {
body: {
search_id: searchId,
keywords,
searched_pdfs: fileKeys,
},
headers: {
Authorization: `Bearer ${(await Auth.currentSession())
.getIdToken()
.getJwtToken()}`,
},
});
Log output
// Put your logs below this line
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:27 (12 by maintainers)
@biddster @kiran-psi sorry to hear about these issues, I’ll investigate.
I found this, and it helped me, to find the issue why my API was not deployed in the full extend anymore the update of amplify and redeployment of my API had a major change. As the OP reported, the original cloudformation-template was removed. A template under build appeared. But it was missing stuff. It didnt deploy my custom authorizers, it missed some paths, it removed some extra settings of the path (like GET method became any, special response headers (CORS), or integration values (like VPC linking))
it would have been cool to be notified about the changes and a good guide how to actually override the api gateway in a smart way - I now ended up to have the old path cf-template content in the override
I dont actually want to override default values…to default values but…you know overriden…