在Elastic beantalk环境中读取数据库配置详细信息的API是什么?

时间:2018-07-17 18:54:38

标签: amazon-web-services elastic-beanstalk amazon-rds

AWS命令行提供API以读取弹性beantalk环境信息:

aws elasticbeanstalk describe-environments --environment-ids 'e-438kcmnae5'

但是,我没有找到文档来从API读取详细的数据库配置(如下面的浏览器控制台所示)。

enter image description here

1 个答案:

答案 0 :(得分:1)

您正在寻找的是DescribeEnvironmentResources Beanstalk API:

aws elasticbeanstalk describe-environment-resources --environment-name <environment-name>

结果:

{
    "EnvironmentResources": {
        ...

        "Resources": [
            ...
            {
                "Type": "AWS::RDS::DBInstance",
                "LogicalResourceId": "...",
                "PhysicalResourceId": "...",
                "Properties": [
                    {
                        "Name": "Endpoint",
                        "Value": "..."
                },
                {
                    "Name": "Port",
                    "Value": "3306"
                }
            }
        ]
    },

    ...
}