{"record":{"id":"4ac77fdb4b235105","repo":"kubernetes/kops","slug":"error-finding-instance-info-for-instance-type-q","errorCode":null,"errorMessage":"error finding instance info for instance type %q: %w","messagePattern":"error finding instance info for instance type %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/new_cluster.go","lineNumber":1750,"sourceCode":"\n\treturn \"\", fmt.Errorf(\"unable to determine default image for cloud provider %q and architecture %q\", cluster.GetCloudProvider(), architecture)\n}\n\nfunc MachineArchitecture(cloud fi.Cloud, machineType string) (architectures.Architecture, error) {\n\tif machineType == \"\" {\n\t\treturn architectures.ArchitectureAmd64, nil\n\t}\n\n\t// Some calls only have AWS initialised at this point and in other cases pass in nil as cloud.\n\tif cloud == nil {\n\t\treturn architectures.ArchitectureAmd64, nil\n\t}\n\n\tswitch cloud.ProviderID() {\n\tcase api.CloudProviderAWS:\n\t\tinfo, err := cloud.(awsup.AWSCloud).DescribeInstanceType(machineType)\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"error finding instance info for instance type %q: %w\", machineType, err)\n\t\t}\n\t\tif info.ProcessorInfo == nil || len(info.ProcessorInfo.SupportedArchitectures) == 0 {\n\t\t\treturn \"\", fmt.Errorf(\"unable to determine architecture info for instance type %q\", machineType)\n\t\t}\n\t\tvar unsupported []ec2types.ArchitectureType\n\t\tfor _, arch := range info.ProcessorInfo.SupportedArchitectures {\n\t\t\t// Return the first found supported architecture, in order of popularity\n\t\t\tswitch arch {\n\t\t\tcase ec2types.ArchitectureTypeX8664:\n\t\t\t\treturn architectures.ArchitectureAmd64, nil\n\t\t\tcase ec2types.ArchitectureTypeArm64:\n\t\t\t\treturn architectures.ArchitectureArm64, nil\n\t\t\tdefault:\n\t\t\t\tunsupported = append(unsupported, arch)\n\t\t\t}\n\t\t}\n\t\treturn \"\", fmt.Errorf(\"unsupported architecture for instance type %q: %v\", machineType, unsupported)\n\tdefault:","sourceCodeStart":1732,"sourceCodeEnd":1768,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/new_cluster.go#L1732-L1768","documentation":"MachineArchitecture queries the AWS EC2 API (DescribeInstanceType) to learn the CPU architecture of the requested instance type; when that call fails, this wrapped error is returned. It is an AWS API failure (throttling, permissions, invalid type name, connectivity), not a kops logic error.","triggerScenarios":"`kops create cluster --instance-type <type>` on AWS where DescribeInstanceType returns an error: instance type name misspelled, EC2 API throttling, missing ec2:DescribeInstanceType IAM permission, or network issues.","commonSituations":"Typo like t3.meduim; API rate limiting during batch operations; restricted IAM policies in CI; VPC without internet egress to EC2 endpoints.","solutions":["Verify the instance type name is a real EC2 type (e.g. t3.medium)","Ensure the credentials/role have ec2:DescribeInstanceType permission","Retry on throttling — kops vfs backoff may not cover this call; add retry or reduce call rate","Check EC2 endpoint connectivity/proxy settings"],"exampleFix":"// before\n--instance-type=t3.meduim\n// after\n--instance-type=t3.medium","handlingStrategy":"retry","validationCode":"// pre-check instance type exists via your own DescribeInstanceType call\n_, err := ec2Client.DescribeInstanceTypes(&ec2.DescribeInstanceTypesInput{\n    InstanceTypes: []ec2types.InstanceType{ec2types.InstanceType(machineType)},\n})","typeGuard":null,"tryCatchPattern":"if err != nil {\n    if throttled(err) {\n        time.Sleep(backoff)\n        // retry\n    }\n    return fmt.Errorf(\"validate instance type %s: %w\", machineType, err)\n}","preventionTips":["Grant ec2:DescribeInstanceType in automation roles","Validate instance type names before running kops","Handle throttling with exponential backoff"],"tags":["aws","ec2","api-error"],"backgroundTag":"aws-api-call-failed","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}