Boto3 create_image for AMI creation - Save ONLY the root volume

Ok, figured it out.

The trick is to not define anything other than the DeviceName in the mapping if you want to omit it using NoDevice

This is working now, adding ANY more information to the mapping will make the NoDevice void and ignored.

Hopefully helps someone else in the future:

{
    'DeviceName': '/dev/sdf',
    'NoDevice': ''
},

I was able to make it work properly with this syntax:

createImage = client.create_image(
    BlockDeviceMappings=[
        {
            'DeviceName': '/dev/sda1',
            'Ebs': {
                'DeleteOnTermination': True,
                'VolumeSize': 20,
                'VolumeType': 'gp2',
                'Encrypted': False
            },
        'DeviceName': '/dev/xvdf',
            'Ebs':{},
        'NoDevice': '', 
        },
    ],
    Description='AMI created by me',
    InstanceId='i-xxxxxxxxxxxxxxxx',
    Name='Insert the AMI name here',
    NoReboot=False,
    DryRun=False,
)