英文:
List available AWS RDS instance type with go SDK
问题
我正在尝试列出我可以为给定的数据库引擎(postgres/mysql)生成的所有可用实例类型。目前可以使用aws
命令行工具来实现,使用以下命令:
aws rds describe-orderable-db-instance-options --engine mysql
更多选项可以在此文档页面中查看 - describe-orderable-db-instance-options
然而,当我尝试使用aws go-sdk来实现相同的功能时,我找不到任何类似的函数可以给我提供可用实例的列表。可以在这里参考文档 - https://pkg.go.dev/github.com/aws/aws-sdk-go/service/rds
我不想尝试列出已配置的实例并检查它们的实例类型。相反,这应该是一个预配置步骤,允许我选择可用的实例类型。
英文:
I'm trying to list all the available instance types that I can spawn for a given db engine (postgres/mysql). This at the moment is possible using the aws
cli with the following command:
aws rds describe-orderable-db-instance-options --engine mysql
more options can be seen on this docs page - describe-orderable-db-instance-options
However when I try to achieve the same with the aws go-sdk I can't find any similar function that can give me the list of available instances. Docs can be referred here - https://pkg.go.dev/github.com/aws/aws-sdk-go/service/rds
I am NOT interested in trying to list the provisioned instance and examine their instance types. Instead this is supposed to be a pre-provisioning step that allows me to choose available instance types.
答案1
得分: 3
可能这就是你在寻找的内容:
> 返回指定数据库引擎、数据库引擎版本和数据库实例类别的可订购的数据库实例选项列表。
用法:
input := &rds.DescribeOrderableDBInstanceOptionsInput{
Engine: aws.String("mysql"),
EngineVersion: aws.String("5.6.27"),
LicenseModel: aws.String("general-public-license"),
Vpc: aws.Bool(true),
}
英文:
Probably this is what you are looking for:
> Returns a list of orderable DB instance options for the specified DB engine, DB engine version, and DB instance class.
Usage:
input := &rds.DescribeOrderableDBInstanceOptionsInput{
Engine: aws.String("mysql"),
EngineVersion: aws.String("5.6.27"),
LicenseModel: aws.String("general-public-license"),
Vpc: aws.Bool(true),
}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论