amplify-hosting
amplify-hosting copied to clipboard
Next.js 13 - Manual deploys via zip file
Before opening, please confirm:
- [X] I have checked to see if my question is addressed in the FAQ.
- [X] I have searched for duplicate or closed issues.
- [X] I have read the guide for submitting bug reports.
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- [X] I have removed any sensitive information from my code snippets and submission.
App Id
d113cc0qzdxa93
AWS Region
us-east-1
Amplify Hosting feature
Deployments
Describe the bug
Trying to upload a zip build of Next.js with SSR. It says deployment successful but the environment URL says Access Denied.
Expected behavior
The URL should show the Next app instead of Access Denied.
Reproduction steps
- Go to any environment URL of the app.
Build Settings
No response
Log output
# Put your logs below this line
2022-12-12T18:21:36 [INFO]: Starting Deployment
2022-12-12T18:21:37 [INFO]: Updating Edge config
n, buildId 0000000008
2022-12-12T18:21:37 [INFO]: Got archive: 29260413 bytes
2022-12-12T18:21:46 [INFO]: Deployment complete
Additional information
No response
Hi @basselabbara 👋🏽 Apologies for this inconvenience but Amplify Hosting currently doesn't support manually deploying SSR apps: https://docs.aws.amazon.com/amplify/latest/userguide/manual-deploys.html.
Please follow this guide instead to deploy Next.js apps with Amplify: https://docs.aws.amazon.com/amplify/latest/userguide/deploy-nextjs-app.html
⚠️COMMENT VISIBILITY WARNING⚠️
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or 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.
This has been identified as a feature request. If this feature is important to you, we strongly encourage you to give a 👍 reaction on the request. This helps us prioritize new features most important to you. Thank you!
I wanted to add that this should not be exclusive to NextJS 13... would be great if it supported NextJS 12 as well.
Additionally, it would be great to trigger a deployment from an S3 package using CDK.
@hloriana I've been having discussions with support about this exact feature. In theory, it seems that there should not be any technical reason why we can't deploy Next JS SSR app using upload of files or S3, as long as the files are organized in some expected way.
It seems that Amplify Hosting does the following:
- Identifies the type of project it is hosting based on the content. There may be some hardcoded rules based on project source (ie. Git vs S3), but regardless, it seems that these can be modified through CLI
aws amplify update-app --app-id <app_id> --platform WEB_COMPUTE
aws amplify update-branch --app-id <app_id> --branch-name <branch_name> --framework 'Next.js - SSR'
-
Build of assets. In terms of Next JS, this would be a next build with some additional AWS specifics steps to build whatever is needed to deploy Lambda@Edge.
-
Infrastructure deployment. S3, CloudFront, Lambda@Edge, IAM, etc...
If I can configure the App properly using commands above and also perform a build on my end that mimics #2, could it be then possible for me to upload the output of that build using Manual approach (DnD files or S3) and trigger #3?
Hi team,
I did a test with git repo with "web_dynamic". And In the building phase, I notice a new "serverless" folder is generated by Amplify in the artifacts.zip
for the following deployment.
Looks like the only difference in the .next
and artifacts.zip
is the "serverless" folder.
Therefore, maybe Amplify could have the ability to know the manually uploaded zip files is from Nextjs project in the building phase, then somehow generating the "serverless" folder for the following deployment.
Is it possible to use the ZIP approach in 2023?
Is it possible to use the ZIP approach in 2023?
i have tried it. but did not work.
As a workaround, my CI/CD process push thing to AWS codecommit. I think it should be possible to upload ZIP to support different CI/CD use cases
any update? Forcing to use amplify CI/CD wouldn't work for all organization cause not everyone wanna stick fully with amplify CI/CD
This feature is highly desired for consistent use of Amplify Hosting from AWS CDK. Given that we can deploy an SPA app from CDK s3 asset to Amplify Hosting (doc), why not for SSR apps?
+1 to this feature I have a case where it would be very benificial to manually deploy a Nuxt 3 app with SSR enabled rather than having to go through ci/cd amplify console
+1 to this feature I have a case where it would be very benificial to manually deploy a Nuxt 3 app with SSR enabled rather than having to go through ci/cd amplify console
It is worth noting that, although not via inbuilt amplify API it is possible to download the build from an artifact repo like AWS CodeArtifact. Avoiding @aws-sdk/*
NodeJS SDK in your webapp build will reduce the total artifact size. And move @aws-sdk/client-codeartifact
into a different package that can download this using OIDC federation, and right permission setup on the amplify role. I use Next.js ISR and this works just fine.
But I would still like to see this feature to inbuilt in AWS APIs - aws cli and aws_amplify_app
terraform.
+1 on this. Manually deploying a SSR app would be really valuable for my use case, otherwise I would need to support two different CI/CD envs for devs, depending on whether they work on SSR apps or not.
Is this still on the radar? Last thing I heard from AWS rep was that this was going to be announced in re:Invent 2023. Came and went. I know AWS does not want to share/commit to roadmaps, but a little bit of news here would help.
+1, manual deployment for SSR via zip files would be helpful