如何获得与AMI类型相关的InstanceTypes?

发布于 2025-01-25 22:32:35 字数 808 浏览 0 评论 0原文

我正在制作一些代码,以便在我们的产品中用于旋转EKS簇。

但是,我需要查询每个区域中可用的实例类型,这些类型将传递给CreateNodeGroup调用。

对CreateNodeGroup的调用之一需要AMI类型。在尝试Amazon UI时,实例类型会根据选择的AMI类型而改变。但是,我无法弄清楚如何适用于这些AMI类型的实例类型:

AL2_X86_64,AL2_X86_64_GPU,AL2_ARM__64,BOTTLEROCKECT_X86_64,bottlerocket_arm_64

我甚至可以描述一个区域的实例类型,但是无法通过如何通过AMI键入AMI键入

任何Hints或帮助。

// Get a list of instance types available in the region
sess, err := session.NewSession(&aws.Config{
    Region:      aws.String("us-west1"),
    Credentials: credentials.NewStaticCredentials(accessKey, secretAccessKey, ""),
})
if err != nil {
    return err
}

svc := ec2.New(sess)
params := &ec2.DescribeInstanceTypesInput{}

types, err := svc.DescribeInstanceTypes(params)
if err != nil {
    return err
}

I'm producing some code to be used in our product to spin up EKS clusters.

However, I need to query the instance types available in each region which is passed to the CreateNodeGroup call.

One of the calls to CreateNodeGroup requires an AMI type. And in experimenting with the Amazon UI, the instance types change depending on what AMI type is selected which makes sense. But, I cannot figure out how to work out what Instance types are applicable to these AMI types:

AL2_x86_64, AL2_x86_64_GPU, AL2_ARM_64, BOTTLEROCKET_x86_64, BOTTLEROCKET_ARM_64

I got as far as describing the Instance types for a region, but cannot work out how to filter that by AMI type

Any hints or help, greatly appreciated.

// Get a list of instance types available in the region
sess, err := session.NewSession(&aws.Config{
    Region:      aws.String("us-west1"),
    Credentials: credentials.NewStaticCredentials(accessKey, secretAccessKey, ""),
})
if err != nil {
    return err
}

svc := ec2.New(sess)
params := &ec2.DescribeInstanceTypesInput{}

types, err := svc.DescribeInstanceTypes(params)
if err != nil {
    return err
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文