EC2 run-instances error: Invalid value ('Encrypted') for param element of list:BlockDeviceMappings of type...












0














According to the AWS CLI documentation, I can specify that a volume should be encrypted and provide the KMS Key Id accordingly. I can't make it work though... what am I doing wrong here?



aws ec2 run-instances --block-device-mappings '[ {"DeviceName": "/dev/sda1", "Ebs": { "DeleteOnTermination": true, "VolumeSize": 10, "VolumeType": "gp2" }}, {"DeviceName": "/dev/sdb1", "Ebs": { "DeleteOnTermination": false, "VolumeSize": 20, "VolumeType": "gp2", "Encrypted": true, "KmsKeyId": "f80d1a0e-9295-4ca7-8f27-2ce79fec9838" }} ]' --image-id $BASE_AMI --count 1 --instance-type $INSTANCE_TYPE --security-group-ids $SEC_GROUPS --subnet-id $SUBNET --key-name "$KEY_PAIR" 


Pretty-printed JSON for block-device-mappings below for ease of reference:



[
{
"DeviceName": "/dev/sda1",
"Ebs": {
"DeleteOnTermination": true,
"VolumeSize": 10,
"VolumeType": "gp2"
}
},
{
"DeviceName": "/dev/sdb1",
"Ebs": {
"DeleteOnTermination": false,
"VolumeSize": 20,
"VolumeType": "gp2",
"Encrypted": true,
"KmsKeyId": "f80d1a0e-9295-4ca7-8f27-2ce79fec9838"
}
}
]


When I run the above command, I get the error you see in the subject line. If I swap the order of the Encrypted and KmsKeyId values around, it complains about KmsKeyId instead.



FWIW, I installed AWS CLI via apt on Ubuntu 14.04.



john@dev3:/home/john$ aws --version
aws-cli/1.2.9 Python/3.4.3 Linux/3.13.0-161-generic









share|improve this question
























  • Current version of awscli is 1.16.52. I don't think you can safely use apt-get to install awscli. I would uninstall it and follow awscli instructions to use pip or the bundled installer.
    – jarmod
    Nov 13 '18 at 1:39










  • Thanks, I'll do that. Couldn't find the current version info in the docs anywhere in my earlier search.
    – John Rix
    Nov 13 '18 at 1:42










  • I don’t think you’ll find that info in docs. May be best to rely on github.com/aws/aws-cli/releases
    – jarmod
    Nov 13 '18 at 1:50










  • Thanks @jarmod. Switching to the latest version as suggested solved the problem. Post your response as an answer so I can accept it!
    – John Rix
    Nov 13 '18 at 10:26
















0














According to the AWS CLI documentation, I can specify that a volume should be encrypted and provide the KMS Key Id accordingly. I can't make it work though... what am I doing wrong here?



aws ec2 run-instances --block-device-mappings '[ {"DeviceName": "/dev/sda1", "Ebs": { "DeleteOnTermination": true, "VolumeSize": 10, "VolumeType": "gp2" }}, {"DeviceName": "/dev/sdb1", "Ebs": { "DeleteOnTermination": false, "VolumeSize": 20, "VolumeType": "gp2", "Encrypted": true, "KmsKeyId": "f80d1a0e-9295-4ca7-8f27-2ce79fec9838" }} ]' --image-id $BASE_AMI --count 1 --instance-type $INSTANCE_TYPE --security-group-ids $SEC_GROUPS --subnet-id $SUBNET --key-name "$KEY_PAIR" 


Pretty-printed JSON for block-device-mappings below for ease of reference:



[
{
"DeviceName": "/dev/sda1",
"Ebs": {
"DeleteOnTermination": true,
"VolumeSize": 10,
"VolumeType": "gp2"
}
},
{
"DeviceName": "/dev/sdb1",
"Ebs": {
"DeleteOnTermination": false,
"VolumeSize": 20,
"VolumeType": "gp2",
"Encrypted": true,
"KmsKeyId": "f80d1a0e-9295-4ca7-8f27-2ce79fec9838"
}
}
]


When I run the above command, I get the error you see in the subject line. If I swap the order of the Encrypted and KmsKeyId values around, it complains about KmsKeyId instead.



FWIW, I installed AWS CLI via apt on Ubuntu 14.04.



john@dev3:/home/john$ aws --version
aws-cli/1.2.9 Python/3.4.3 Linux/3.13.0-161-generic









share|improve this question
























  • Current version of awscli is 1.16.52. I don't think you can safely use apt-get to install awscli. I would uninstall it and follow awscli instructions to use pip or the bundled installer.
    – jarmod
    Nov 13 '18 at 1:39










  • Thanks, I'll do that. Couldn't find the current version info in the docs anywhere in my earlier search.
    – John Rix
    Nov 13 '18 at 1:42










  • I don’t think you’ll find that info in docs. May be best to rely on github.com/aws/aws-cli/releases
    – jarmod
    Nov 13 '18 at 1:50










  • Thanks @jarmod. Switching to the latest version as suggested solved the problem. Post your response as an answer so I can accept it!
    – John Rix
    Nov 13 '18 at 10:26














0












0








0







According to the AWS CLI documentation, I can specify that a volume should be encrypted and provide the KMS Key Id accordingly. I can't make it work though... what am I doing wrong here?



aws ec2 run-instances --block-device-mappings '[ {"DeviceName": "/dev/sda1", "Ebs": { "DeleteOnTermination": true, "VolumeSize": 10, "VolumeType": "gp2" }}, {"DeviceName": "/dev/sdb1", "Ebs": { "DeleteOnTermination": false, "VolumeSize": 20, "VolumeType": "gp2", "Encrypted": true, "KmsKeyId": "f80d1a0e-9295-4ca7-8f27-2ce79fec9838" }} ]' --image-id $BASE_AMI --count 1 --instance-type $INSTANCE_TYPE --security-group-ids $SEC_GROUPS --subnet-id $SUBNET --key-name "$KEY_PAIR" 


Pretty-printed JSON for block-device-mappings below for ease of reference:



[
{
"DeviceName": "/dev/sda1",
"Ebs": {
"DeleteOnTermination": true,
"VolumeSize": 10,
"VolumeType": "gp2"
}
},
{
"DeviceName": "/dev/sdb1",
"Ebs": {
"DeleteOnTermination": false,
"VolumeSize": 20,
"VolumeType": "gp2",
"Encrypted": true,
"KmsKeyId": "f80d1a0e-9295-4ca7-8f27-2ce79fec9838"
}
}
]


When I run the above command, I get the error you see in the subject line. If I swap the order of the Encrypted and KmsKeyId values around, it complains about KmsKeyId instead.



FWIW, I installed AWS CLI via apt on Ubuntu 14.04.



john@dev3:/home/john$ aws --version
aws-cli/1.2.9 Python/3.4.3 Linux/3.13.0-161-generic









share|improve this question















According to the AWS CLI documentation, I can specify that a volume should be encrypted and provide the KMS Key Id accordingly. I can't make it work though... what am I doing wrong here?



aws ec2 run-instances --block-device-mappings '[ {"DeviceName": "/dev/sda1", "Ebs": { "DeleteOnTermination": true, "VolumeSize": 10, "VolumeType": "gp2" }}, {"DeviceName": "/dev/sdb1", "Ebs": { "DeleteOnTermination": false, "VolumeSize": 20, "VolumeType": "gp2", "Encrypted": true, "KmsKeyId": "f80d1a0e-9295-4ca7-8f27-2ce79fec9838" }} ]' --image-id $BASE_AMI --count 1 --instance-type $INSTANCE_TYPE --security-group-ids $SEC_GROUPS --subnet-id $SUBNET --key-name "$KEY_PAIR" 


Pretty-printed JSON for block-device-mappings below for ease of reference:



[
{
"DeviceName": "/dev/sda1",
"Ebs": {
"DeleteOnTermination": true,
"VolumeSize": 10,
"VolumeType": "gp2"
}
},
{
"DeviceName": "/dev/sdb1",
"Ebs": {
"DeleteOnTermination": false,
"VolumeSize": 20,
"VolumeType": "gp2",
"Encrypted": true,
"KmsKeyId": "f80d1a0e-9295-4ca7-8f27-2ce79fec9838"
}
}
]


When I run the above command, I get the error you see in the subject line. If I swap the order of the Encrypted and KmsKeyId values around, it complains about KmsKeyId instead.



FWIW, I installed AWS CLI via apt on Ubuntu 14.04.



john@dev3:/home/john$ aws --version
aws-cli/1.2.9 Python/3.4.3 Linux/3.13.0-161-generic






amazon-web-services amazon-ec2 aws-cli






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 13 '18 at 1:31

























asked Nov 13 '18 at 1:25









John Rix

2,9832330




2,9832330












  • Current version of awscli is 1.16.52. I don't think you can safely use apt-get to install awscli. I would uninstall it and follow awscli instructions to use pip or the bundled installer.
    – jarmod
    Nov 13 '18 at 1:39










  • Thanks, I'll do that. Couldn't find the current version info in the docs anywhere in my earlier search.
    – John Rix
    Nov 13 '18 at 1:42










  • I don’t think you’ll find that info in docs. May be best to rely on github.com/aws/aws-cli/releases
    – jarmod
    Nov 13 '18 at 1:50










  • Thanks @jarmod. Switching to the latest version as suggested solved the problem. Post your response as an answer so I can accept it!
    – John Rix
    Nov 13 '18 at 10:26


















  • Current version of awscli is 1.16.52. I don't think you can safely use apt-get to install awscli. I would uninstall it and follow awscli instructions to use pip or the bundled installer.
    – jarmod
    Nov 13 '18 at 1:39










  • Thanks, I'll do that. Couldn't find the current version info in the docs anywhere in my earlier search.
    – John Rix
    Nov 13 '18 at 1:42










  • I don’t think you’ll find that info in docs. May be best to rely on github.com/aws/aws-cli/releases
    – jarmod
    Nov 13 '18 at 1:50










  • Thanks @jarmod. Switching to the latest version as suggested solved the problem. Post your response as an answer so I can accept it!
    – John Rix
    Nov 13 '18 at 10:26
















Current version of awscli is 1.16.52. I don't think you can safely use apt-get to install awscli. I would uninstall it and follow awscli instructions to use pip or the bundled installer.
– jarmod
Nov 13 '18 at 1:39




Current version of awscli is 1.16.52. I don't think you can safely use apt-get to install awscli. I would uninstall it and follow awscli instructions to use pip or the bundled installer.
– jarmod
Nov 13 '18 at 1:39












Thanks, I'll do that. Couldn't find the current version info in the docs anywhere in my earlier search.
– John Rix
Nov 13 '18 at 1:42




Thanks, I'll do that. Couldn't find the current version info in the docs anywhere in my earlier search.
– John Rix
Nov 13 '18 at 1:42












I don’t think you’ll find that info in docs. May be best to rely on github.com/aws/aws-cli/releases
– jarmod
Nov 13 '18 at 1:50




I don’t think you’ll find that info in docs. May be best to rely on github.com/aws/aws-cli/releases
– jarmod
Nov 13 '18 at 1:50












Thanks @jarmod. Switching to the latest version as suggested solved the problem. Post your response as an answer so I can accept it!
– John Rix
Nov 13 '18 at 10:26




Thanks @jarmod. Switching to the latest version as suggested solved the problem. Post your response as an answer so I can accept it!
– John Rix
Nov 13 '18 at 10:26












1 Answer
1






active

oldest

votes


















1














It looks like the most recent release of awscli is 1.16.x so I would update the awscli and re-test. It's possible that this was fixed (or was unsupported in version 1.2.x, which you are running).



More generally, I don't think you can safely use apt-get to install the latest awscli on Ubuntu. I would uninstall it and follow awscli instructions for Linux to use pip or the bundled installer.






share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53272440%2fec2-run-instances-error-invalid-value-encrypted-for-param-element-of-listb%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    It looks like the most recent release of awscli is 1.16.x so I would update the awscli and re-test. It's possible that this was fixed (or was unsupported in version 1.2.x, which you are running).



    More generally, I don't think you can safely use apt-get to install the latest awscli on Ubuntu. I would uninstall it and follow awscli instructions for Linux to use pip or the bundled installer.






    share|improve this answer


























      1














      It looks like the most recent release of awscli is 1.16.x so I would update the awscli and re-test. It's possible that this was fixed (or was unsupported in version 1.2.x, which you are running).



      More generally, I don't think you can safely use apt-get to install the latest awscli on Ubuntu. I would uninstall it and follow awscli instructions for Linux to use pip or the bundled installer.






      share|improve this answer
























        1












        1








        1






        It looks like the most recent release of awscli is 1.16.x so I would update the awscli and re-test. It's possible that this was fixed (or was unsupported in version 1.2.x, which you are running).



        More generally, I don't think you can safely use apt-get to install the latest awscli on Ubuntu. I would uninstall it and follow awscli instructions for Linux to use pip or the bundled installer.






        share|improve this answer












        It looks like the most recent release of awscli is 1.16.x so I would update the awscli and re-test. It's possible that this was fixed (or was unsupported in version 1.2.x, which you are running).



        More generally, I don't think you can safely use apt-get to install the latest awscli on Ubuntu. I would uninstall it and follow awscli instructions for Linux to use pip or the bundled installer.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 13 '18 at 12:16









        jarmod

        18.4k63948




        18.4k63948






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53272440%2fec2-run-instances-error-invalid-value-encrypted-for-param-element-of-listb%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            List item for chat from Array inside array React Native

            Thiostrepton

            Caerphilly