- Newest
- Most votes
- Most comments
Yes, the amplify/ folder is required in your Git repository for Next.js SSR (Gen 1) full-stack deployments on Amplify Hosting.
When you deploy using Amplify's Git-based CI/CD and hosting service, Amplify needs access to the CloudFormation templates and configuration files contained in the amplify/ directory to properly provision and manage your backend resources. During the deployment process, Amplify will provision a build environment, clone your repository, deploy your Amplify backend, and then deploy your frontend.
This is why your deployment attempts failed when you added the amplify/ folder to .gitignore but succeeded when you included it in your repository. The Amplify Hosting build process requires these files to perform the necessary backend checks and updates (essentially running an "amplify push" operation) before deploying your frontend.
When you initialize an Amplify project with the "amplify init" command, it creates this folder structure in your project's root directory with the initial project configuration and generates the project metadata files. These files are essential for Amplify to understand and manage your backend resources during the CI/CD process.
Sources
Deploy and host app - Next.js - AWS Amplify Documentation
How Amplify works - Next.js - AWS Amplify Documentation
Explore key workflows for Amplify CLI - Next.js - AWS Amplify Documentation
answered 10 months ago
Hey,
Hope you're keeping well.
For Amplify Gen 1 full‑stack deployments, the amplify/ folder must be present in the connected Git repo. That directory contains the backend environment configuration, CloudFormation templates, and team-provider-info.json that the Amplify Console build process uses to run amplify pull or amplify push during deployment. If it’s missing, the build can’t reconcile the frontend with your existing backend resources, which is why your deployment failed when it was git‑ignored.
Thanks and regards,
Taz
answered 8 months ago
Relevant content
- AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated 4 years ago
