无法使用 AWS .NET SDK 获取 amazon RDS 实例
我无法从本地计算机连接到 RDS 中的数据库...
这是我的代码:
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];
DBInstance
列表始终为空,即计数为 0。而我知道我有 RDS实例已启动并正在运行,就像我使用管理控制台创建它们一样。
此外,当我使用从 RDS 管理控制台获取的端点准备连接字符串时,我可以创建表等。
我已在安全组中提供访问权限。
我错过了什么吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我猜测您的实例不在美国东部地区。
默认情况下,SDK 连接到 us-east。如果要连接到其他区域,则需要在 AmazonRDSClient 上指定。
endpointUrl 的可能值为:
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.
Possible values for endpointUrl are: