Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Add support for tagged RDS DBInstances #1061

wants to merge 9 commits into


None yet

gertjanol commented Oct 15, 2012

These commits add support for listing, creating and removing tags to and from RDS-DBInstances (ListTagsForResource, AddTagsToResource and RemoveTagsFromResource API calls).

Amazon requires an ARN to reference the DBInstance on which the actions are performed, but doesn't supply this ARN, afaik. I added a property to the DBInstance-class, which uses IAM (for the account-id) to construct the ARN itself when asked for. It's not very clean, but I didn't see another way. If Amazon does supply the ARN in another way, or in the future, this could easily be removed while retaining backwards compatibility.

I'm hoping to add support for a TaggedRDSResource, similar to the TaggedEC2Resource.

I welcome your thought and suggestions!

PS: this is the same pull-request as #1050, but from it's own branch

[update 2012-11-06]
Implement classmethods for getting, adding and removing tags as methods from boto.rds.DBInstance. This is different than the implementation of EC2 tags. This is due to differences in the API: the EC2 API offers tags for more than just Instances, hence the superclass TaggedEC2Object. It also supplies all tags from a resource in each DescribeResource API call.

RDS only offers tags for DBInstances, and separate API calls are needed to retrieve them.

However, the interface for the user (dbinstance.tags, dbinstance.add_tag(key, value) and dbinstance.remove_tag(key)) is the same as for EC2 tags. If Amazon in the future does provide tags in the same way as EC2 tags, this could easily be refactored (and maybe even use the same superclass).

Can we get this in?

@garnaat garnaat referenced this pull request Dec 3, 2012


RDS tagging #1141

👍 would love to see this merged in


gertjanol commented May 13, 2013

Me too :). But I haven't received feedback from Mitch, so I don't know what it's waiting for.

J5 commented May 28, 2013

Thanks for this patch. I have it monkey patched into our code. One thing I would like to mention is that you are getting the account_id via an IAM call which we may not have access to since we are doing these calls as a third party on behalf of our clients using restricted IAM roles. Instead we grab the account id through the security groups API:

sg = ec2.get_all_security_groups()
account_id = sg[0].owner_id


reversefold commented Aug 19, 2013

I had previously implemented the same functionality and bowed to this one, but I've recently opened another pull request, #1641 which also has unit tests for everything.


phspagiari commented Nov 6, 2013

+1 This is already merged?

gkope commented Nov 13, 2013


+1. This would be nice to have.

+1. Could really do with being able to see the tags on RDS instances as well as on EC2.

+1 Could definitely use this feature as well.

Would someone on the Boto team mind telling us what you'd want for this to get merged? It looks like #1641 has unit tests, which wasn't enough to get it merged, either. I'm happy to take a stab at whatever improvements you guys are looking for.


toastdriven commented Feb 1, 2014

@bpollack This PR wasn't merged because there aren't any tests on it. The rough consensus is that some combination of this & #1061 + tests would be best, but there hasn't been time to get back there.

We're still discussing what to do about RDS, given that we're lagging significantly behind on the module vs. the API. I'll update here when we have something to share.

+1 for sure


danielgtaylor commented Feb 20, 2014

Please note that boto now contains a new rds2 module with the latest Amazon RDS API support. It is a low-level module, but supports all the new features and is significantly easier for us to maintain.


This module will be released soon in boto 2.26.0.

Is there a ETA on 2.26.0?

wigsy commented Feb 26, 2014



danielgtaylor commented Feb 27, 2014

Boto-2.26.0 is now out! Closing this PR for the time being - please resubmit with tests if you wish to backport these features to boto.rds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment