Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amplify's auto-generated auth functions using deprecated version of Node.js (nodejs16.x) #13565

Closed
2 tasks done
chrislrobert opened this issue Jan 30, 2024 · 5 comments
Closed
2 tasks done
Labels
auth Issues tied to the auth category of the CLI pending-triage Issue is pending triage

Comments

@chrislrobert
Copy link

How did you install the Amplify CLI?

npm install -g @aws-amplify/cli

If applicable, what version of Node.js are you using?

v18.16.1

Amplify CLI Version

12.10.1

What operating system are you using?

Mac

Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

No

Describe the bug

The auth support auth-generates four Lambda functions like the following:

  1. amplify-login-custom-message-e832f3ae
  2. amplify-login-create-auth-challenge-e832f3ae
  3. amplify-login-define-auth-challenge-e832f3ae
  4. amplify-login-verify-auth-challenge-e832f3ae

All four are created with a nodejs16.x engine, but that engine is past end of life and will be deprecated for support purposes this coming June. I've updated my CLI to 12.10.1, tried updating the auto and re-pushing, tried force-pushing, etc., but always nodejs16.x is used.

Expected behavior

Expect:

  1. New deployments use a newer version of Node.js to start
  2. Existing deployments have a clear upgrade path

Reproduction steps

  1. Add auth to project
  2. Push
  3. Run aws lambda list-functions --region us-east-1 --output text --query "Functions[?Runtime=='nodejs16.x'].FunctionArn" to observe that the four auto-created functions are running on the EOL nodejs16.x.

Project Identifier

No response

Log output

No response

Additional information

No response

Before submitting, please confirm:

  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • I have removed any sensitive information from my code snippets and submission.
@chrislrobert chrislrobert added the pending-triage Issue is pending triage label Jan 30, 2024
@josefaidt
Copy link
Contributor

Hey @chrislrobert 👋 thanks for raising this! Later versions of the CLI like the version you are using will update the auto-generated Lambda's used to supplement the CloudFormation configuration for your Auth resources.

Runtime versions can be found in the auth trigger CloudFormation template inside your auth resource's build/ directory. Can you try running amplify update auth, stepping through the prompts making no modifications, and see if this upgrades the runtime?

@josefaidt josefaidt added auth Issues tied to the auth category of the CLI pending-response Issue is pending response from the issue author labels Feb 1, 2024
@chrislrobert
Copy link
Author

chrislrobert commented Feb 1, 2024

Hey @chrislrobert 👋 thanks for raising this! Later versions of the CLI like the version you are using will update the auto-generated Lambda's used to supplement the CloudFormation configuration for your Auth resources.

Runtime versions can be found in the auth trigger CloudFormation template inside your auth resource's build/ directory. Can you try running amplify update auth, stepping through the prompts making no modifications, and see if this upgrades the runtime?

Thanks, @josefaidt, for the reply. Looking in the auth build folder, I can see that the templates in there do properly have nodejs18.x. And, if I list nodejs18 functions with aws lambda list-functions --region us-east-1 --output text --query "Functions[?Runtime=='nodejs18.x'].FunctionArn", I can see that all of the functions labeled with my app+branch are v18. However, there are still these lingering nodejs16 functions triggering the warnings from AWS:

  1. amplify-login-custom-message-e832f3ae
  2. amplify-login-create-auth-challenge-e832f3ae
  3. amplify-login-define-auth-challenge-e832f3ae
  4. amplify-login-verify-auth-challenge-e832f3ae

Maybe those aren't actually connected to this specific app? Indeed, if I search the app's repo, there are no references. But I only have the one app, so if it's not linked to that app, where did they come from — and do you think it's safe to just go into Lambda and delete them?

FWIW, I see the same four functions in my production environment (but with different ID numbers on the end). That suggests to me that it wasn't anything created randomly by a developer, as no developers have access to the production environment. They must have been auto-created by an Amplify deployment...

(Also, sorry, I did try amplify update auth already.)

@github-actions github-actions bot removed the pending-response Issue is pending response from the issue author label Feb 1, 2024
@chrislrobert
Copy link
Author

@josefaidt, I've done some Googling and have confirmed that these four functions aren't unique to me. They appear to be related to the admin UI, and there is a comment in aws-amplify/amplify-studio#23 suggesting that there is no CloudFormation stack for those functions. Also, I see somebody has reported this very issue in aws-amplify/amplify-studio#1085, so I'll add a comment there. Is that the better place to chase this down?

@ykethan
Copy link
Member

ykethan commented Feb 1, 2024

@chrislrobert the lambda functions specified are related amplify studio, login flow. I see you already did add a comment on the issue. Will close this issue and followup on aws-amplify/amplify-studio#1085 with the team.

@ykethan ykethan closed this as not planned Won't fix, can't repro, duplicate, stale Feb 1, 2024
Copy link

github-actions bot commented Feb 1, 2024

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth Issues tied to the auth category of the CLI pending-triage Issue is pending triage
Projects
None yet
Development

No branches or pull requests

3 participants