Can we add instances manually in EB data tier - amazon-web-services

I have started using elastic beanstalk with tomcat8-java8 application. Elastic beanstalk setup a nice application with RDS data tier. Is it possible to add another instance, which I created manually, in data tier as a redis caching server.
Thanks for any feedbacks.

There's nothing about Elastic Beanstalk that says it cannot communicate with other servers.
An application running under Elastic Beanstalk can access other resources such as S3 buckets, databases, and other servers, etc. as long as the various permission levels allow (VPC, security groups, etc.)
So you can add a redis server manually that your Elastic Beanstalk application can utilize. You just need to ensure that your application can "get to" the redis server.

Related

No EC2 instances are running but website is being served

So I have a website that was still being served even though I did not have an EC2 instance running on the us-east-1 dashboard.
I did have a load balancer running. When I terminated the load balancer the website is no longer being served.
My question is this...
Even though I had a load balancer there were no EC2 instances running. Where is the website being loaded from?
Doesn't an EC2 instance need to be running?
Not really, first of all, check if you have an Instance running in a different AWS region. If not, your site could be running in multiple other AWS Services like ECS, EKS or could be deployed Serverless (if the website is a Single Page Application: react, angular, vue).
So to answer your question: No, you don't need an EC2 instance running on AWS to host a website. And load balancers can be deployed in front of many other services that are not running on EC2.

How to deploy a single web application(nodejs+reactjs) on two EC2 server for load balancing and autoscaling?

My client is asking me to deploy web application (nodejs backend+reactjs frontend) on two EC2 servers. Inorder to achieve good load balancing and autoscaling based on traffic,
Note: client doesn't want to go for single server of high version
There are multiple ways of achieving a satisfying architecture for this problem. If we are looking into using EC2 instances we can do the following:
Deploy your back-end into Target Group for an Auto Scaling Group and put an Application Load Balancer in front of it. Instances can automatically register to the load balancer, which can distribute traffic between them.
Deploy your static front-end application into an S3 bucket, if necessary, use a CloudFront distribution for caching and faster loads.
Assuming the front-end is a SPA (browser-generated HTML), then host the React part on S3 + CloudFront
Regarding deploying Node on EC2:
Use CloudFormation to setup the infrastructure (the EC2 machines, ASG, and Load Balancer)
Then use CodeDeploy to deploy / update the application
Here is a post on deploying Node.js using CodeDeploy: https://hub.packtpub.com/deploy-nodejs-apps-aws-code-deploy/
You might find it easier to use Elastic Beanstalk though

Static IP for internal communication in AWS for microservices

I have 7 Spring microservices with Eureka Server which I would like to deploy into AWS Elastic Beanstalk. Every time when I redeploy microservice I see that the url address is changed. Is it possible to use internal static IP for every AWS service?
I was also facing this problem with managing EB instances remotely, I have fixed this in two ways:
For myself I use eb ssh from EB CLI to remotely access instances. As the CLI gives you an option to select which instance you want to connect to if there are more than one. If your microservices are in a private subnet you need a bastion to connect to your instances remotely.
using AWS System manager / Session Manager
You can install a System manager agent on your elastic beanstalk environment using ebextensions. Using Systems managers; Session manager you can start a session towards your microservice and all your commands will be logged towards S3 (can be usefull for change management / complaincy)
As I want straight to these two options; I never fixed the issue where private IP's changed.

Automatically Blocking Suspicious IPs on Elastic Beanstalk instance

I have an Elastic Beanstalk instance that is running a Flask app. I want to know if there is any way through AWS to automatically block IP addresses that are doing unusual activity on my site.
This could be a range of things, for example:
Send several GET requests over and over
Trying to POST without a CSRF
And more. Any ideas? Thanks.
Generally, for that you would front your EB with application load balancer and AWS Web Application Firewall.
This setup is documented in the recent AWS blog and other sources:
How do I protect my Elastic Beanstalk environment against attacks from known unwanted hosts?
Setting up AWS Web Application Firewall (WAF) with Elastic Beanstalk
Guidelines for Implementing AWS WAF

Does AWS Beanstalk hosting charge for every EC2 instance it creates?

I am new to AWS ElasticBeanstalk. As i have started working on AWS ElasticBeanstalk i have some confusion which are as follows.
1.Does Amazon charge for every EC2 instance which is created to run ElasticBeanstalk app under free tier.
2.Is it possible to host multiple app under samne EC2 instance which is created for Elasticbeanstalk i.e ASp.net ,Web Api and angular 4 app under same elasticbeanstalk.
Please help me to clear my issues.
Thanks
If the EC2 instances used for Elastic Beanstalk fall under the free tier (i.e. within the first 12 months of account ownership, they're small enough instances, use less than 750 hours/month, etc.), then they'll be free. It doesn't matter if the instances are used for an Elastic Beanstalk application or something else.
Yes, it is possible to host multiple Elastic Beanstalk applications on the same EC2 instance. See this related StackOverflow question.