question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unknown parameter 'TagSpecifications' for ec2 run_instances() method

See original GitHub issue

With Boto3 Version 1.4.5 on Python 3.6, using the keyword TagSpecifications on the run_instances() method of boto3.client(‘ec2’) results in an ‘Unknown parameter on input’ error.

Example:

       ec2 = boto3.client('ec2')
        tags = [
                     {'Key':'project','Value': 'foo'},
                     {'Key': 'owner', 'Value': 'walter'},
               ]
        tag_specification = [{'ResourceType': 'instance', 'Tags': tags},]

        response = ec2.run_instances(ImageId=image_id,
                                     MaxCount=requested_number,
                                     MinCount=1,
                                     TagSpecifications=tag_specification,
                                     InstanceType=instance_type,
                                     DryRun=dry_run)

yields:

Traceback (most recent call last):
  File "./create_ec2_instance.py", line 190, in <module>
    main('one_site')
  File "./create_ec2_instance.py", line 178, in main
    instances = provision_instances(image_id,requested_number=1)
  File "./create_ec2_instance.py", line 71, in provision_instances
    DryRun=dry_run)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/botocore/client.py", line 253, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/botocore/client.py", line 517, in _make_api_call
    api_params, operation_model, context=request_context)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/botocore/client.py", line 572, in _convert_to_request_dict
    api_params, operation_model)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/botocore/validate.py", line 270, in serialize_to_request
    raise ParamValidationError(report=report.generate_report())
botocore.exceptions.ParamValidationError: Parameter validation failed:
Unknown parameter in input: "TagSpecifications", must be one of: DryRun, ImageId, MinCount, MaxCount, KeyName, SecurityGroups, SecurityGroupIds, UserData, InstanceType, Placement, KernelId, RamdiskId, BlockDeviceMappings, Monitoring, SubnetId, DisableApiTermination, InstanceInitiatedShutdownBehavior, PrivateIpAddress, Ipv6Addresses, Ipv6AddressCount, ClientToken, AdditionalInfo, NetworkInterfaces, IamInstanceProfile, EbsOptimized

Sure enough, TagSpecifications isn’t listed in the “must be one of:” list.

Cheers, Walter

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
wmszeligacommented, Aug 11, 2017

Ah, sorry. Upgrading botocore from 1.5.8 to 1.5.95 seems to have solved the problem. Might I suggest bumping the minimum botocore version in the boto3 wheel file to 1.5.95 (or whatever is most appropriate)?

0reactions
dstufftcommented, Aug 11, 2017

Great! Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

run-instances — AWS CLI 1.27.34 Command Reference
When you launch an M3 instance, we ignore any instance store volumes specified in the block device mapping for the AMI. Ebs ->...
Read more >
Boto EC2: Create an instance with tags - python - Stack Overflow
Got the same error ( Unknown parameter in input: "TagSpecifications" ), and I am using Boto3 1.4.4. The same code was working few...
Read more >
AWS CLI ec2 run-instances fails with --tag-specifications ...
After much frustration and searching, I stumbled across a page that explained that the syntax for run-instances is documented incorrectly.
Read more >
EC2 — Boto 3 Docs 1.9.42 documentation - AWS
import boto3 client = boto3.client('ec2'). These are the available methods: accept_reserved_instances_exchange_quote(); accept_vpc_endpoint_connections ...
Read more >
types - Go Packages
To specify no maximum limit, omit this // parameter. ... progress - The EC2 Fleet or Spot Fleet request is in the process...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found