getInstanceTypesFromInstanceRequirements 总是 return 0 个实例类型

getInstanceTypesFromInstanceRequirements always return 0 instance types

我是运行以下API:

GetInstanceTypesFromInstanceRequirementsResult instanceRequirementsResult = this.amazonEC2Client
            .getInstanceTypesFromInstanceRequirements(new GetInstanceTypesFromInstanceRequirementsRequest()
                    .withInstanceRequirements(new InstanceRequirementsRequest().
                                                    withVCpuCount(new VCpuCountRangeRequest().withMin(0).withMax(100)).
                                                    withMemoryMiB(new MemoryMiBRequest().withMin(0).withMax(100))).
                                                    withArchitectureTypes(ArchitectureType.X86_64).
                                                    withVirtualizationTypes(VirtualizationType.Hvm).withMaxResults(100));

根据 docs,这是您需要传递的最少参数数。但是这 returns 0 次。我错过了什么?

来自docs

MemoryMiB:

The minimum and maximum amount of memory, in MiB.

Type: MemoryMiBRequest object

Required: Yes

参数MemoryMiB 以MB 表示。因此,如果最大为 100MB,您将无法获得结果。

尝试将其更改为更高的值(例如 4096 = 4GB)或 omitting the 'Max' field to set as unlimited:

Max

The maximum amount of memory, in MiB. To specify no maximum limit, omit this parameter.

Type: Integer

Required: No