如何获得与AMI类型相关的InstanceTypes?
我正在制作一些代码,以便在我们的产品中用于旋转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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论