문제

What is the correct syntax for mapping a snapshot onto an AMI using awscli? More explicitly, how do I map the old syntax 'ec2-register -s snap-9abc1234 --kernel 99abcdef' onto the new syntax 'aws ec2 --register-image' ?

도움이 되었습니까?

해결책

It's the following:

aws ec2 register-image --kernel-id <your-kernel> --root-device-name /dev/sda1 --block-device-mappings [list in JSON shown below]

      [
        {
          "VirtualName": "string",
          "DeviceName": "string",
          "Ebs": {
            "SnapshotId": "string",
            "VolumeSize": integer,
            "DeleteOnTermination": true|false,
            "VolumeType": "standard"|"io1",
            "Iops": integer
          },
          "NoDevice": "string"
        }
        ...
      ]

You can run aws ec2 register-image help for help on the command.

Make sure you are using the awscli python package on not the aws package as that one is different (not the official one)

Here's a link to the github repo:

https://github.com/aws/aws-cli

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top