How to access files deployed in aws elasticbeanstalk - node.js

I have deployed node.js code on aws elasticbeanstalk creating a new environment. The app is successfully deployed. I want to access the files. I used ssh to the remote machine but the I can't find the code

Elastic Beanstalk places the deployed code in /var/app/current
Note that you shouldn't be making changes on the Elastic Beanstalk server directly.

Adding to the last answer, remember that you need to select enable SSH to your instances when launching application. Else, you won't be able to SSH into any AWS Elastic Beanstalk instance.

If you found this question but you're not using ssh, you could download the zip after clicking on a version in the console.

Related

NodeJS EC2 app - way of using configurable env variables like herokus config vars?

I am trying to migrate from heroku to AWS EC2 for my node apps. Is there an easy way to setup and manage environment variables like the settings -> config vars on heroku? I am running an EC2 instance on Amazon Linux and can't find out an easy way to manage and access env vars from code.
Heroku PaaS is known for its GUI and features but in the backend Heroku is running your codebase on the AWS ec2 which is controlled by Heroku Architecture.
You can try some open-source PaaS on which you can add your was instance but they need some sort of server space too. You can see this one independent PaaS software which is inspired by Heroku.

Which is the best approach to deploy MERN stack app on AMAZON EC2?

I am googling a lot to be sure the best approach to deploy MERN stack app on aws ec2 ... in some examples Nginx being used in server (expressjs) part and in some cases its being used for Recatjs part and the express js part is just hosted in node , React even can be hosted in s3 I guesss .. so what is the best approach however?
Without configuring the server yourself in EC2, you can simply use managed Node.js hosting provided by AWS Elastic Beanstalk.
If you want to directly configure EC2 instance and deploy, you can follow this tutorial to do the deployment https://jasonwatmore.com/post/2019/11/18/react-nodejs-on-aws-how-to-deploy-a-mern-stack-app-to-amazon-ec2

How does one deploy multiple micro-services in Node on a single AWS EC2 instance?

We are pretty new to AWS and looking to deploy multiple services into one EC2 instance.
Each micro-service is developed in its own repository.
Each service will have its own endpoint URL
Services may talk to each other
Services can be updated/deployed separately
Do we need a beanstalk for each? I hope not.
Thank you in advance
So the way we tackled a similar issue at our workplace was to leverage the multi-container docker platform supported by Elastic Beanstalk in most AWS regions.
The way this works in brief is, we had dedicated repositories for each of our services in ECR (Elastic Container Registry) where the different "versioned" images were deployed using a deploy script.
Once that is configured and set up, all you would need is deploy a Dockerrun.aws.json file which basically highlights all the apps you would want to deploy as part of the docker cluster into 1 EC2 instance (make sure it is big enough to handle multiple applications). This is the file where one would also highlight link between applications (so they can talk to one another), port configurations, logging drivers and groups (yea we used AWS CloudWatch for logging) and many other fields. This JSON is very similar to one's docker-compose.yml which is used to bring up your stack for local development and testing.
I would suggest checking out the sample example configuration that Amazon provides for more information. Also, I found the docker documentation to be pretty helpful in this regard.
Hope this helps!!
It is not clear if you have a particular tool in mind. If you are using any tool for deployment of a single micro-service, multiple should be the same.
How does one deploy multiple micro-services in Node on a single AWS
EC2 instance?
Each micro-service is developed in its own repository.
Services can be updated/deployed separately
This should be the same as deployment of a single micro-service. As long as they have different path and port that they are running on, it should be fine.
Each service will have its own endpoint URL
You can use nginx as a reverse proxy which can redirect your request from port 80 to the required port of your micro service.
Services may talk to each other
This again should not be an issue. You can either call them directly with the port number or via fully qualified name and come back via nginx.

I have an angular app with a Node server - no DB yet. How to deploy on AWS?

I'm not sure where and how to start with AWS for deploying, very confused at the moment. It seems like I deploy my server on Elastic Beanstalk, but then where does my build and static files go? S3 I'm guessing? Should I just follow the tutorial for Beanstalk? Thanks!
You can use Elastic Beanstalk to host your entire application including Static files where it will resides in the web server.
The downside of it is the performance for large scale applications where you can leverage AWS S3 and CloudFront. So if you are a starter with AWS, then I would recommend to consider Elastic Beanstalk for entire application hosting for the moment.

Amazon EC2 IIS-8 User's Permission Write Access

I am using Amazon EC2 using Elastic Beanstalk deployment process through Visual Studio all is working well, except that when the application is deployed it does not have by default write permission; so I had to manually Remote Desktop the individual machine; and give it write permission through IIS site and under permissions.
How can I automate this process, since amazon servers adds on to load balancer using auto-scaling etc.?
Or If I change one, the other to follow will copy the exact same thing, which I had done manually?
I am little confused, first time deploying, please help?
Thanks
Yes, you can use ebextensions config to set permissions on the directory after the instance spins up. Here is an example of someone creating a directory and setting the permissions on the new directory, you should be able to adapt to your circumstances:
AWS Beanstalk ebextensions on windows

Resources