Connecting to Amazon RDS DB through Sequel Pro - amazon-web-services

I am trying to connect Sequel Pro to my Amazon RDS Instance, and while it looks like I have set my security groups correctly to allow access to all-traffic, attempting to connect to it still fails.
This is what I did:
In IAM, I created a new user, and added that user to a group that has a policy that allows full access to RDS.
For the security group that is attached to my RDS instance, I added an Inbound rule to allow all traffic of type MYSQL/Aurora
However, when I enter the endpoint displayed in the RDS screen, along with the username and password I created through IAM, I get an access denied message. Any ideas what I may be missing?

Related

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

How to add the ip of an instance in a vpc to the security group of rds ec2 classic instance with aws cli

I describe my scenario which is not like the one described here Unable to add Ec2 VPC Security group in Non VPC RDS MySQL Security group? or here Adding Spot Instances to the Security Group of an RDS Instance:
I have a fleet of spots in a ec2 vpc and I want to give you access to a rds data base that is in ec2 classic. Just like the second link, my spots are renewed from time to time and I have to be able to add the ip of the lawnched machine to the security group of the rds instance.
The configuration from the console is possible and works fine, just go to the security group of your rds instance and add a rule with a CIDR/IP.
But by doing so by cli with this command:
aws rds authorize-db-security-group-ingress --db-security-group-name default --cidrip xxx.xx.x.xxx/32
I get this error:
HTTPSConnectionPool(host='ec2.eu-west-1c.amazonaws.com', port=443): Max retries exceeded with url: / (Caused by NewConnectionError('<botocore.awsrequest.AWSHTTPSConnection object at 0x__________>: Failed to establish a new connection: Errno -2] Name or service not known',))
Details
I created an IAM user with this Permissions boundary: AuthorizeDBSecurityGroupIngress
Both spots vpc and rds ec2 classic instances are in the same eu-west-1c availability zone.
In the documentation of the command don't specify specifically that you can't do https://docs.aws.amazon.com/cli/latest/reference/rds/authorize-db-security-group-ingress.html. Also it would be strange that it can be done from the console and not from the cli.
I don't know what I'm missing, any ideas?
There's another way of using Security Groups, instead of using an IP, you use a security group ID.
For example:
You create a new security group, let's call it "MySpecialSG". Don't add any rules to this SG.
Then create a new SG, let's call it "Allow my Other SG". Now you will add an inbound rule, but instead of using IPs, you will use "MySpecialSG" group ID and the port you need.
This last SG is the one that you will assign to your DB instance.
I've finally solved the problem. The solution was that I was not adding the IAM user credentials with the access policy necessary to perform that action.
To use aws cli through the user-data of the instance you have to export the credentials of that IAM user as environment variables.
Info:
Policies for the classic link
Credentials export

This IAM user does not have permission to use AWS Config

Currently, I am exploring the (application) load balancing option in AWS.
I was able to create instances, subnets, target group and application scaling group in a VPC. Each of the instances is accessible through the instance’s ‘Public DNS’. (i.e., I run a toy nodejs based program in port 80 these instances - and it works fine and accessible through the public DNS url.)
However, when I try to access it through the load balancer, I get the error
An error occurred while a request was made to AWS Config
However, when I tried to access the AWS Config, I get the error
This IAM user does not have permission to use AWS Config. Check your
IAM user permissions or contact your administrator to get access.
Also, in the ‘Target Group(s)’, these instances are marked as ‘unhealthy’. On the other hand, the same instances are marked as ‘healthy’ in the ‘Application Scaling Group’.
Could this be an IAM user permission issue (i.e., of the account that I am using)?

AWS Rds security group settings consideration

We've setup a RDS for MS SQL database. I'd like to limit database connection only from our own applications such as Website, API, others. Normally we setup the security group like:
The problem is it allows anybody to access. I'd like to only allow some IPs to connect. But I can't do that for my API app which it's running through a Load balancer because there is no fixed ip address.
Any suggestions?
Don't use IP restrictions. When configuring Security Group rules, in the Source field you can also enter Security Group ID of the Instance that you want to allow to access your RDS.
Example from Adding Rules to a Security Group:

Organizing Security Groups in AWS

I'm having an issue with Security Groups in AWS. I have 4 security groups, 2 in EC2 and 2 in RDS.
ec2-prod
ec2-test
rds-prod
rds-test
On the other hand, I have a database DEV, having the rds-test security group associated.
In the rds-test inbound rules I've added ec2-prod and ec2-test, and my IP is added into the ec2-test, but for some reason it's not working.
If I add my IP directly on rds-test I can connect to the database, but this behavior make no sense to me.
Just in case, in the ec2-test security group, my IP has permission ALL TCP.
Any ideas?
It's the normal behavior. You have to add your IP to the DB security group.
The DB security group defines the access the RDS DB.
The EC2 security group defines the access the EC2 instance.
The fact that your IP is authorized to access the instance doesn't mean your IP is authorized to access the DB (but you can connect to the DB from the instance).