AWS:无法将 Amazon QuickSight 连接到 RDS

AWS: Unable to connect Amazon QuickSight to RDS

我们在 West-1(加利福尼亚北部)有几个 MySQL RDS 实例,想使用 QuickSight 创建一些报告。第一个问题是 QuickSight 仅在 West-2(俄勒冈)可用并且没有显示我们的 RDS,所以我在 West-2 中创建了一个只读副本数据库。

我仍然无法连接到我的实例,它显示了以下错误: 连接失败。确保您的实例可从适当的 Amazon QuickSight IP 地址范围访问。

我已经在入站规则中创建了一个允许 IP 54.70.204.128/27 的安全组并将其应用于我的实例。最终让我连接到实例的是将实例的 'Publicly Available' 字段设置为 'Yes'.

但是,我的老板希望它保留 'No',我们也可以使用 MySQL SSH 连接方法通过 DOMO 连接到非 public 实例。

是否可以在不将“可公开访问”设置为“是”的情况下使 QuickSight 和 RDS 之间的连接正常工作?

您的 RDS Replica 是否在 VPC 中?

先识别再创建安全组并附加必要的规则!

我会推荐你​​阅读Authorizing Connections from Amazon QuickSight to Amazon RDS Instances

我就此向 AWS 提出了支持请求,他们的答复如下。我会试试的。

嗨阿利斯泰尔,

感谢您联系 AWS 高级支持。今天很高兴为您提供帮助。

我了解到您想从 QuickSight 连接到您的 Prod RDS 数据库,但收到错误消息:"Not Validated"。您还想知道是否有解决方法看到您的 RDS 实例不可公开访问。

Amazon Web Services 提供了一项名为 CloudFormation 的服务,该服务有助于自动化某些流程。 此服务将允许您的 RDS 实例通过自定义 NAT 实例连接到 QuickSight。因此,您不必将数据库放在 public 子网中。 附件是一个 CloudFormation 模板 (NAT_RDS_Provisioning.template),在启动 CloudFormation 堆栈 [1] 后,将创建一个实例和一个安全组,然后输入所需的变量。 然后,这将允许从您定义的源端口上的源地址访问 EC2 实例的端点,这将允许 QuickSight 访问您的 RDS 实例服务器,而无需创建您的 RDS 实例 public.

要启动此 CloudFormation 堆栈,请参阅以下步骤……请记住,您创建此堆栈的区域必须与您的数据库所在的区域相同。

1. From your AWS console navigate to " CloudFormation " 
2. Click " create stack ", you will then be asked to Select Template, you will then select " Design template".
3. Next to Parameters - click " Mappings ", at the bottom of that page you will see: Components and Template. 
4. Select " Template " and copy and paste the provided script in there. (see attached: NAT_RDS_Provisioning.template)(Please use case link below signature)
5. In the top right hand corner you will see a refresh button, click to refresh. 
6. On the top left there is a square with a tick inside (clicking this validates the template). 
7. Once validated - click the little cloud with the arrow in it , this will create the stack.
8. You will be taken back to the select template page, click "next" in the bottom right corner.
9. Under Specify Details, name your stack and then complete all Parameters, info on parameters provided below: 
    9.1 Stack name  (Example: NAT-RDS-QuickSight)
    9.2 DestinationAddress - Add your RDS instance Endpoint here. (That way when a fail-over occurs the endpoint should be updated in 60 seconds maximum).
    9.3 DestinationPort - The service remote destination port: 
    9.4 InstanceType - The EC2 instance class. (The size of the NAT instance will depend on the amount of data you want to pull into QuickSight) 
    9.5 KeyName - Name of an existing EC2 KeyPair to enable SSH access to the instance: 
    9.6 SourceAddress - The source range you want to allow access from: example 0.0.0.0/0.
    9.7 SourcePort - The port the service must listen on: 
    9.8 Subnet - a Public Subnet that is in the same VPC as your RDS instance:
10. Click " Next "
11. On the Options page - complete the desired fields and click " Next " (Optional)
12. Review all information - (Confirm the details for your NAT EC2 instance)
13. Under template you will see "Estimate cost - click on cost to give you an idea of the monthly estimate to have this service running) 
14. Then  select " Create " in the bottom right hand corner.
15. On the main CloudFormation Page, click "refresh" You will the notice the status of your Stack being created.
16. If you navigate to your EC2 console you will notice your NAT instance running / creating.

请确保 NAT 实例可以访问您的 RDS 实例,这包括安全组设置。 这应该通过在 RDS 实例数据库的安全组中包含 NAT 实例的 IP 地址来完成。

然后您应该能够按照设置访问 EC2 IP 地址和端口,这会将流量转发到您的数据库。

在创建上面的内容时,您会看到所涉及的估算成本,但是我在下面添加了两个 link 以获取更多相关信息以及成本计算器。

成本将与 EC2 实例相同,这将启动 AWS Linux 最新标准 AMI,吞吐量将由实例决定 class [2] & [3]:

[1] https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/GettingStarted.Walkthrough.html
[2] https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html
[3] https://calculator.s3.amazonaws.com/index.html

希望以上信息和解决方案对您有所帮助。

如果您 运行 在上述任何方面遇到任何困难,或者如果您不确定任何事情,请随时与我联系,我将非常乐意提供帮助。

要查看此信函中包含的名为 'NAT-RDS-Provisioning-Template.template' 的文件,请使用签名下方给出的大小写 link。

此致,

Delene T。 亚马逊网络服务


在此处查看提供的模板文件内容:https://pastebin.com/m67sz4bR


幸运的是,情况发生了变化。

可以将 Amazon QuickSight 连接到 VPC 中 RDS 中的数据库,尽管 AWS 文档并不清楚所有必要的步骤。

基本上,按照这里的步骤, https://docs.aws.amazon.com/quicksight/latest/user/working-with-aws-vpc.html 但请确保您将创建 两个 个安全组:

  • 您的 VPC 中实例的安全组
  • Amazon 安全组 QuickSight 的弹性网络接口

让我们从第二个开始: 它是 QuickSight 分配给网络接口 (ENI) 的接口,该接口将在您的 VPC 中自动创建以访问数据库。这是我一开始没有创建的,这是您在 QuickSight 中用来创建 VPC 连接的那个。详细信息在上述文档的“Amazon QuickSight 弹性网络接口的安全组规则”段落中。

第一个看起来像这样: 入站:根据 DB 的 TCP / 端口 - 在 MySQL 的情况下是“MYSQL/Aurora,TCP, 3306”,来源:之前的安全组。 不要忘记将此添加到您的数据库实例。

祝你好运。