Question

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

Was it helpful?

Solution

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

http://boto.cloudhackers.com/en/latest/ref/rds.html#boto.rds.RDSConnection.get_all_dbparameter_groups

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top