Migrate static IP from amazon EC2 to Lightsail - amazon-web-services

I am running a server in the Amazon EC2 which has a static IP Address, Can we migrate static IP from amazon EC2 to Lightsail, Is it possible?

It is not possible to migrate the Elastic IP Address from EC2 to Lightsail, because the service and control panel is different. Lightsail is a simplified service with console targeted to people who are familiar with other VPS provider.

Related

How to access AWS Lightsail MySQL database from VPC (EC2 instance)?

I have an Amazon Lightsail MySQL database.
I have enabled "VPC Peering" in Amazon Lightsail account.
I have an EC2 server in the VPC account that is "peered" with Lightsail.
Now I want to access the Lightsail database from the EC2 instance. I know the "easy way" is to enable the "Public mode" in the Lightsail database. In this way, the endpoint is publicly available on Internet, so you can connect from anywhere.
I want to avoid this, so here is the question: Is it possible to access the Lightsail database from the EC2 instance, using the internal VPC communication? If not, is there any other way to make this connection more secure? Maybe a way to whitelist IPs in Lightsail databases?
Thanks!
To reproduce your situation, I did the following:
Launched an Amazon Lightsail Database (I chose PostgreSQL)
Enabled VPC Peering in the Lightsail console (Account / Advanced)
Launched an Amazon EC2 instance in the Default VPC (which is the only one that Lightsail connects to)
Tried connecting from the EC2 instance to the Lightsail database
It did not work.
The database DNS Name successfully resolved to an IP address that was in the correct range for VPC Peering. However, when attempting to connect to the database, psql hung for a long time before failing. This is an indication of no network connection between the EC2 instance and the Lightsail database.
Normally, the way to fix it would be to check the Security Groups, but Lightsail does not support security groups. It would appear that access to the Lightsail database is locked-down to the Lightsail network and it is not accessible via VPC Peering.

Odoo on aws and docker containers

I am running odoo on an ec2 instance -aws.
The odoo code is pulled from the docker hub, running inside the ec2 via docker containers.
The problem is that the ec2 doesn't have a static IP and every time it's restarted the connection with odoo disappears.
This is at least the theory am working with.
I would appreciate other solutions or might be problems
You need to associate an Elastic IP to your ec2 instance. This will give your ec2 a fixed public IP address
You can follow the documentation in AWS below:
Associate an Elastic IP address with an instance or network interface.
Take in account that there are costs associated: pricing

Can't connect between AWS Elastic Beanstalk and another EC2 Security Group

I have a spring boot application that is deployed to AWS Elastic Beanstalk and a Mongo database the is deployed on an EC2 instance.
I created two security groups: one for the EC2 instance and another one for Elastic Beanstalk to open the connection to each other.
However, the spring boot app still can't connect to Mongo (on the EC2 IP address).
Login to your AWS account and navigate to EC2 (Compute) dashboard.
Click the Security Group for the Ec2 instance in which MongoDB is installed
In the inbound tab, click edit
Add the private IP of the EC2 where beanstalk is running and the MongoDB port. This will allow the connectivity from your Spring boot application to MongoDB.
To test the connectivity, SSH into your EC2 where beanstalk is running and telnet the IP: port where MongoDB is running.

How to configure your firewall to allow REST requests from Amazon EC2 hosted website

I have a website hosted in the Amazon EC2 which calls a web service hosted locally in my personal network.
I wish to restrict access to my web service using my firewall so that only the website hosted in Amazon EC2 can access it. I don't want to open the web service up to the entire internet.
The website that is hosted in the Amazon EC2 which sits behind a load balancer. This means the ip address of my website can change at any time.
I know you can get the ip addresses via the following http://docs.aws.amazon.com/general/latest/gr/aws-ip-ranges.html
But these could change and I need to update my firewall again.
How should I configure my firewall to only allow access from my website hosted in Amazon EC2 AWS?
If you have one instance on your AWS setup, you will need attach a Elastic IP. Elastic IPs are not transient and will allow you to whitelist the IP in your firewall. If you are in a VPC and your instances are in private subnet, you will need to use ELastic IPs for your NAT gateways & you will need to whitelist the NATs. Any request originating from your AWS network will use ELastic Ip as broadcast IP.

Amazon web services - Connect Elastic Beanstalk with ElastiCache

I have a node.js application running on an Amazon Elastic Beanstalk (EB) environment
in my app code I create an instance of memcached (my elastic cache) like this:
var Memcached = require('memcached');
var memcached = new Memcached('my-elastic-cache-configuration-endpoint:11211');
In creating my ElastiCache cluster I used the security group of the EC2 instance running my EB app.
And in that security group I have allowed inbound access on port 11211 as described here:
Amazon ElastiCache Step 3: Authorize Access
However my memcached ElastiCache is still not accessible from my app.
I have tested it locally to make sure the code is alright etc. and everything checks out.
Does anyone know what I may be missing?