AWS CDK,无法创建ARM实例

时间:2020-08-15 17:11:17

标签: python-3.x amazon-web-services amazon-ec2 arm cdk

我正在使用AWS CDK,并且正在尝试创建ARM实例。这是我得到的错误:

TypeError: latest_amazon_linux() got an unexpected keyword argument 'cpuType'

这是我要使用的python代码:

    amzn_linux = ec2.MachineImage.latest_amazon_linux(
        cpuType=ec2.AmazonLinuxCpuType.ARM_64,
        generation=ec2.AmazonLinuxGeneration.AMAZON_LINUX_2,
        edition=ec2.AmazonLinuxEdition.STANDARD,
        virtualization=ec2.AmazonLinuxVirt.HVM,
        storage=ec2.AmazonLinuxStorage.GENERAL_PURPOSE
        )

1 个答案:

答案 0 :(得分:0)

并回答我自己的问题:

    amzn_linux = ec2.MachineImage.latest_amazon_linux(
        generation=ec2.AmazonLinuxGeneration.AMAZON_LINUX_2,
        edition=ec2.AmazonLinuxEdition.STANDARD,
        virtualization=ec2.AmazonLinuxVirt.HVM,
        storage=ec2.AmazonLinuxStorage.GENERAL_PURPOSE,
        cpu_type=ec2.AmazonLinuxCpuType.ARM_64
        )