DEV Community

Mark Orina for AWS Community Builders

Posted on

Deploy an Astro v3.6.1 app on AWS Amplify (GLIBC_2.27 or GLIBC_2.28 not found on build :bug fix)

Why Astro?
Astro is an all-in-one web framework for building fast, content-focused websites. It is really good for SEO especially as it is lightning-fast website performance, making it ideal for modern web applications and static websites.

AWS Amplify
AWS Amplify is a fully managed CI/CD and hosting service that is perfect for web applications.

Key Points:
-Fully Managed CI/CD: Amplify takes care of the complexities of the CI/CD pipeline, allowing developers to focus on building and refining their applications.
-Hosting Excellence: With AWS Amplify, hosting becomes a breeze, ensuring your web applications are readily available to users.

Prerequisite:
1st create an auto app on your local machine.
Use this tutorial to create your 1st astro app:
Link: https://docs.astro.build/en/tutorial/1-setup/2/

Once it is on your Github we can now set it up on AWS Amplify.
This will done by creating a CI/CD pipeline from GitHub to AWS Amplify where the app will be deployed.

Deploy to AWS:

  1. Log in to AWS and navigate to Amplify in the N. Virginia region or any other region you like.
  2. Click "Get Started" and select "Host your web app" as demonstrated.: AWS Amplify Console
  3. Click on Get Started & click on Host your web app.
  4. Choose GitHub and install AWS Amplify (us-east-1) Image description
  5. You'll be redirected to a page to install and authorize AWS Amplify on GitHub. Select the GitHub repository for your Astro app. Mine is https://github.com/OrinaOisera/Astro_app Image description
  6. After successful authorization, choose the branch (e.g., master) and proceed by clicking "Next." Image description
  7. Navigate to the app build and test settings. Image description
  8. Scroll down to the advanced settings, locate "Live Package Update," and update the Node.js version to 20. Image description
  9. Save your changes and initiate the deployment.
  10. Expect the build to fail. Image description 11.Click on "Build," leading you to the build logs, where you'll identify an issue related to Node.js version compatibility. Image description Astro v 3 require Node js 18 and AWS amplify fail to build due to version `GLIBC_2.27' not found (required by node) Is because the Linux version is not the latest one.
  11. In the sidebar, go to build settings and scroll to "Build Image Settings." Image description Build an image is Amazon Linux default
  12. Update "Build an image" from "Amazon Linux default" to "Amazon Linux:2023," and save the changes. Image description
  13. Scroll back up and click "Redeploy this version" on the top right. Image description
  14. Verify that the deployment is successful & Click the URL to preview the website.

Top comments (0)