Oleg Dulin
Oleg Dulin

Reputation: 1457

Secure interaction between VPC and EC2-Classic instances

I am faced with a chicken and egg problem. I currently have a server in EC2 classic, as well as an RDS instance -- in EC2 classic as well. The EC2 instances also interact with Cassandra cluster, which also resides in EC2 classic.

However, I need to move RDS into the VPC. Now, in an ideal world, I'd have all of my stuff in VPC at this point. However, that presents a major migration challenge and I'd like to minimize impact on users and keep steps to minimum -- this is mainly because of the Cassandra cluster.

It turns out that I cannot create security group rules between VPC and Non-VPC security groups.

So, how can I have RDS in VPC that my EC2 instances can access w/o having to open up my RDS to the entire world ?

Any help is greatly appreciated.

UPDATE: So, one idea I had is to assign elastic IPs to my EC2 instances and add IPs explicitly to the security group for RDS within VPC. Would that work ? (trying it now using https://github.com/skymill/aws-ec2-assign-elastic-ip)

Upvotes: 0

Views: 310

Answers (2)

Oleg Dulin
Oleg Dulin

Reputation: 1457

So, I ended up solving it exactly like I described -- assign elastic IPs to my EC2 instances and add IPs explicitly to the security group for RDS within VPC. It ended up working great.

Upvotes: 0

Ben Whaley
Ben Whaley

Reputation: 34426

Yes, unfortunately that's the only way to do it. You cannot use DNS in security groups, so you're stuck with IP address.

Upvotes: 1

Related Questions