How do I setup Security Groups for Amazon RDS (non VPC)? - amazon-web-services

I've successfully launched an Amazon RDS instance (non VPC!) in the Ireland region. Now I need to set the Security Group settings, but these are not present in my console when selecting Ireland. When selecting Virginia the "Security Groups" item shows up in the left menu, but not when selecting Ireland. After digging through Google for hours it seems I need to setup the Security Groups through Amazon EC2. This seems weird to me because I don't need EC2, my app will not be hosted at Amazon (for now). Anyways, creating the Security Groups in EC2 doesn't change anything in my Amazon RDS console, I still can't find the Security Groups settings item in the left nav and thus cannot set CIDR/IP to 0.0.0.0/0.

Related

AWS EC2 instance periodically drops security group

I am using EC2 with Elastic Beanstalk to deploy a Spring Boot application. This deployment connects to an RDS MySQL instance and an assigned default security group allows the communication.
For a 3rd time, I have found the security group has been dropped from the EC2s list of groups, resulting in degraded Spring Boot, in which Boot is stuck in a startup loop (I am not sure why brought it down)
A separate Boot/EBS deployment uses this same group for RDS connectivity, and has never experienced this.
Has anyone else experienced this? Logs reveal nothing other than connection timeout to RDS.
To troubleshoot this issue, you can use AWS CloudTrail. Using AWS CloudTrail, you can trace who is detaching security group from the related AWS EC2 Instance. This kind of event is logged as ModifyNetworkInterfaceAttribute with event source as ec2.amazonaws.com.
Here you can find AWS CloudTrail user guide.
Note:Typically, CloudTrail delivers an event within 15 minutes of the API call/event.
I believe your problem is you are attaching the security groups to the instance using EC2 console instead of using EB environment's configuration.
Go to EB console, chose your environment, click on configuration.
Click Edit on the Instances section, add security groups from this location. Doing so will ensure that all your security groups are applied when EB is creating instances as an example when it scale-out.

How to connect my Amazon Workspace with AWS RDS?

I have an Amazon Workspace running inside the Private Subnet. In the same subnets i have launched my RDS. I have give access to the Workspace security group to access the RDS inside RDS security group.
Even after all this configuration, i'm getting timedout error whenver i'm trying to connect to RDS from the workspace.
You must allow outbound access for the specific port on the security group attached to the WorkSpace and inbound access from the WorkSpace on the RDS security group (you can reference the security group IDs instead of ip-addresses).
Take also a look on the AWS Reachability Analyzer to check if everything should work. (use the network interface of your WorkSpace)
https://docs.aws.amazon.com/vpc/latest/reachability/getting-started.html

If I want to connect EC2 to RDS in a VPC, what hostname should I use?

I have an application running in EC2 and a PostgreSQL db running in RDS, both inside the same VPC. I believe I have created the necessary security group, but how do I determine the hostname of the db server to use from my application?
Expand the row for that instance in the RDS dashboard. Then you can see the DNS name to use next to "Endpoint:".
My RDS instance in the image above has the domain: [redacted].us-west-2.rds.amazonaws.com. Hovering over the information icon (i on a dark circle) next to it shows me the security groups that can access it.

Find the Elastic Beanstalk Security Group and Configure the Connection to RDS

I was trying to configure my EB to talk to an external RDS instance. Found an AWS document but found it's way too complicated, and many descriptions don't match what I have on the AWS configuration pages. Since I have configured to access RDS from ec2 and from my local machine before, I know I just need to find the security group of my EB instance and add it to RDS security group's Inbound access rules. However, while I searched hard I cannot find where the EB instance security group is. The closest thing I can find is a dash connected 6-part long string in the Instance Configuration page in the EB environment dashboard. But copying this long string RDS access rule is rejected as non-valid.
Eventually I found the security group of the EB which I can add into RDS access rules. It's not straightforward, but it's indeed related to the security group on the Instance Configuration page of the EB environment. First on EB environment page, tap the Configuration button, and tap the gear button on the Instance Configuration panel
Once on the Instance configuration detail page, find the EC2 security groups entry, copy part of the string, like the erased part in this picture
Then open another window and go to the RDS instance dashboard, tap on the Configuration Detail, find the Security Group and tap into it. On the bottom of the Security Group configuration page, Edit the rules and add a new Inbound rule, paste the copied partial EB security group into it, the browser will automatically prompt the correct security group in the sg-xxxx format. Select it and configure the Type as either All Traffic or of your particular DB type, and Voila, your EB instance can now talk to the RDS.

Can't find the DB security group in Amazon RDS console

Not sure if Amazon recently removed DB security group.
Created a DB instance as shown below. But there is no DB security group tab on the left!
Back to the dashboard, it says I have 2 DB security groups. However I was redirected to the EC2 security groups when clicked it.
How can I create and configure the DB security groups now?
Thanks!
After creating VPC the DB security group shows up in the RDS console. Indeed there are some changes Amazon made about the DB security group since Jan 2013.
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.RDSSecurityGroups.html#Overview.RDSSecurityGroups.APIMigration