以编程方式获取 AWS RDS 连接字符串
Programatically get AWS RDS connection string
有没有办法通过 aws api 获取 RDS 数据库的连接字符串?形式为:
postgres://username:password@host/db_name
不,没有 API 调用可以为您构建该字符串。
但是,使用 DescribeDBInstances API call 您可以检索 MasterUsername
、DBName
("the name of the initial database of this instance that was provided at create time, if one was specified when the DB instance was created") 和主机(通过 Endpoint.Address
字段)并构建你自己的字符串。
对于密码,您必须以安全的方式自行提供,因为 RDS 无法通过 API 调用检索它。
有没有办法通过 aws api 获取 RDS 数据库的连接字符串?形式为:
postgres://username:password@host/db_name
不,没有 API 调用可以为您构建该字符串。
但是,使用 DescribeDBInstances API call 您可以检索 MasterUsername
、DBName
("the name of the initial database of this instance that was provided at create time, if one was specified when the DB instance was created") 和主机(通过 Endpoint.Address
字段)并构建你自己的字符串。
对于密码,您必须以安全的方式自行提供,因为 RDS 无法通过 API 调用检索它。