iann0036 / AWSConsoleRecorder

Records actions made in the AWS Management Console and outputs the equivalent CLI/SDK commands and CloudFormation/Terraform templates.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ec2.RunInstances python "BlockDeviceMapping" typo

jbananas opened this issue · comments

Describe the bug
Python ec2.RunInstances "BlockDeviceMappings" parameter incorrectly generating as "BlockDeviceMapping".

Related Mapping
ec2.RunInstances

Related Language
Python

To Reproduce
Steps to reproduce the behavior:

  1. Start recorder
  2. From EC2 Dashboard click Launch Instance
  3. Select default amazon linux 2 ami
  4. Select default t2.micro instance type
  5. Change default VPC/subnet to anything else.
  6. Next, Next, Next
  7. On security group setup page, choose any existing security group.
  8. Next next finish through wizard

Expected behavior
boto3 ec2 client run_instances() argument is "BlockDeviceMappings" (see https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ec2.html#EC2.Client.run_instances). Recorder is currently outputting "BlockDeviceMapping".

For example:

response = ec2_client.run_instances(
    ImageId='ami-009d6802948d06e52',
    MaxCount=1,
    MinCount=1,
    KeyName='mykey',
    InstanceType='t2.micro',
    Placement={
        Tenancy='default'
    },
    Monitoring={
        Enabled=False
    },
    DisableApiTermination=False,
    InstanceInitiatedShutdownBehavior='stop',
    CreditSpecification={
        CpuCredits='standard'
    },
    EbsOptimized=False,
    BlockDeviceMapping=[
        {
            DeviceName='/dev/xvda',
            Ebs={
                VolumeSize=8,
                DeleteOnTermination=True,
                VolumeType='gp2'
            }
        }
    ]
)

Fixed the typo.

Thanks for raising!