postgresql - 以编程方式获取 AWS RDS 连接字符串

标签 postgresql amazon-web-services amazon-rds

有没有办法通过 aws api 获取 RDS 数据库的连接字符串?形式为:

postgres://username:password@host/db_name

最佳答案

不,没有 API 调用可以为您构建该字符串。

但是,使用 DescribeDBInstances API call您可以检索 MasterUsernameDBName(“创建时提供的此实例的初始数据库的名称,如果在创建数据库实例时指定的话” ) 和主机(通过 Endpoint.Address 字段)并自己构建字符串。

对于密码,您必须以安全的方式自行提供,因为 RDS 无法通过 API 调用检索它。

关于postgresql - 以编程方式获取 AWS RDS 连接字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46179785/

相关文章:

java - AWS : how to fix S3 event replacing space with '+' sign in object key names in json

amazon-web-services - DynamoDB - 关键元素与架构不匹配

amazon-web-services - 如何在 Amazon 的 Aurora DB 中更改 character_set_server?

mysql - 在 PostgreSQL 中使用 SQL 平衡值

postgresql - 在 PostgreSQL 上创建数据库转储时出错

sql - 在 postgres 中使用 upsert 和 nodejs 中的 json 文件

postgresql - 将远程转储恢复到 RDS

python - pyodbc - "Data source name not found, and no default driver specified"

amazon-web-services - 如何使用 AWS SDK for Java V2 从 Amazon S3 存储桶读取文件

sql-server - AWS RDS (SQL Server) 可疑的暴力登录尝试