LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-13-2017, 01:42 AM   #1
darthguinea
LQ Newbie
 
Registered: Jan 2017
Posts: 14

Rep: Reputation: Disabled
boto3 python aws route53


Hi,

I am trying to use boto3 to create a new DNS record, however I seem to be getting back a pretty ambiguous error back. I have played around with some of the parameters from:

https://boto3.readthedocs.io/en/deve...ce_record_sets

I have searched for examples of this but have not been able to find any.

Code:
    [12/01/2017 09:57:12] [INFO]: get_zone_data found zone [{u'ResourceRecordSetCount': 11, u'CallerReference': 
    '6A78SD-88E9-11F7-B1C6-A8S7DAS8D7',
     u'Config': {u'PrivateZone': False}, u'Id': '/hostedzone/ASD678ASD78', u'Name': 'test.mydomain.com.'}]
    Traceback (most recent call last):
      File "example.py", line 6, in <module>
        dns.add(name='hurried.me')
      File "scale/scale/net/dns.py", line 99, in add
client.change_resource_record_sets(**params)
      File "/usr/local/lib/python2.7/site-packages/botocore/client.py", line 251, in _api_call
        return self._make_api_call(operation_name, kwargs)
      File "/usr/local/lib/python2.7/site-packages/botocore/client.py", line 537, in _make_api_call
        raise ClientError(parsed_response, operation_name)
    botocore.exceptions.ClientError: An error occurred (InvalidInput) when calling the ChangeResourceRecordSets operation: Invalid request
My code:
Code:
    def add(self, name=None,
            type='A',
            location='172.32.0.1',
            weight=10,
            ttl=10,
            private=False,
            ):

    zone = self.get_zone_data(name, private)
                        #'Weight': weight,

    params = {
        'HostedZoneId': 'C0P6YPA54A',
        'ChangeBatch': {
            'Changes': [{
                'Action': 'CREATE',
                    'ResourceRecordSet': {
                        'Name': 'test.mydomain.com',
                        'Type': 'A',
                        'TTL': 300,
                    }
                },]
        }
    }

    client = self.session.client('route53')
    client.change_resource_record_sets(**params)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I got error while installing python-tk python-psycopg2 python-twisted saili kadam Linux - Newbie 1 09-05-2015 03:03 AM
cannot connect to AWS from pc stu7 Linux - Networking 2 05-26-2015 09:10 AM
[SOLVED] script for AWS Skaperen Linux - Virtualization and Cloud 2 03-25-2015 05:05 AM
LXer: Back Up Route53 To S3 LXer Syndicated Linux News 0 06-07-2013 04:10 PM
LXer: Python Python Python (aka Python 3) LXer Syndicated Linux News 0 08-05-2009 08:30 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration