views:

83

answers:

2

I'm not able to connect to my database in RDS from local machine....

Here is my code:

Amazon.RDS.AmazonRDSClient client = new Amazon.RDS.AmazonRDSClient(myPublicKey, myPrivateKey);

Amazon.RDS.Model.DescribeDBInstancesRequest instanceRequest = new Amazon.RDS.Model.DescribeDBInstancesRequest();

Amazon.RDS.Model.DescribeDBInstancesResponse instanceResponse = new Amazon.RDS.Model.DescribeDBInstancesResponse();

instanceResponse = client.DescribeDBInstances(instanceRequest);

Amazon.RDS.Model.DBInstance instance = instanceResponse.DescribeDBInstancesResult.DBInstance[0];

The DBInstance list is always empty i.e. the Count is 0. Whereas I know that I have RDS instances UP and running as I have created them using the management console.

Also, when I prepare the connection string using the endpoint which I got from the RDS management console, I'm able to create table and all.

I have provided access in the security group.

Am I missing something?

A: 

Im going to guess that your instance is not in the us-east region.

By default the SDK connects to us-east. If you want to connect to another region, you need to specify it on the AmazonRDSClient.

Amazon.RDS.AmazonRDSClient service = new Amazon.RDS.AmazonRDSClient(
  awsAccessKeyId,
  awsSecretAccessKey,
  new Amazon.RDS.AmazonRDSConfig().WithServiceURL(endpointUrl));

Possible values for endpointUrl are:

https://rds.us-east-1.amazonaws.com (Default)

https://rds.us-west-1.amazonaws.com

https://rds.eu-west-1.amazonaws.com

https://rds.ap-southeast-1.amazonaws.com

BigJoe714
Nope... :(The instance is in US-east region. Also when I see in the management console I found that the endpoint has **us-east-1.rds.amazonaws.com** appended in the last..
Manish
I am stumped. I copied and pasted your *exact* code into Visual Studio and plugged in my credentials and I saw my RDS instance in us-east. Sorry!
BigJoe714
I am really not sure why I'm not able to get the instances programmatically. While I can access the Database instance using the endpoint taken from management console by building the connection string. By this, I can conclude, at least access is not an issue. What do u say Joe?
Manish
A: 

I have the same issue with RDS instances. It was working fine until one point, then i started seeing the same issue as manish. Did you folks figure out the reson? - Satya

Satya