Reputation: 4447
Trying to modify a database parameter group on AWS RDS with boto, I hit upon the error below:
from boto import rds
conn = rds.connect_to_region('eu-west-1', aws_access_key_id=AWS_ACCESS_KEY_ID, aws_secret_access_key=AWS_SECRET_ACCESS_KEY)
pg = conn.get_all_dbparameters('mygroup')
pg.add_param('slow_query_log', True, 'immediate')
TypeError
"unknown type (<type 'str'>)"
File: /usr/local/lib/python2.6/dist-packages/boto/rds/parametergroup.py, Line: 175
Any help would be appreciated
Upvotes: 1
Views: 2575
Reputation: 8109
Try something like this:
pg = conn.get_all_dbparameters('mygroup')
pg2 = conn.get_all_dbparameters('mygroup', marker = pg.Marker)
pg2['slow_query_log'].value = True
pg2['slow_query_log'].apply(True)
The conn.get_all_dbparameters() method returns max. 100 rows. However there are about 180 DB Parameters that can be modified. Therefore you have query in two steps. The first method call returns a Marker that you can use for your second query. In the second query you will have your slow_query_log available
Upvotes: 5