diff --git a/moto/rds2/models.py b/moto/rds2/models.py index c9c617f5b..728cb9e25 100644 --- a/moto/rds2/models.py +++ b/moto/rds2/models.py @@ -424,7 +424,7 @@ class SubnetGroup(object): class RDS2Backend(BaseBackend): def __init__(self): - self.arn_regex = re_compile(r'^arn:aws:rds:.*:[0-9]*:db:.*$') + self.arn_regex = re_compile(r'^arn:aws:rds:.*:[0-9]*:(db|es|og|pg|ri|secgrp|snapshot|subgrp):.*$') self.databases = {} self.security_groups = {} self.subnet_groups = {} diff --git a/tests/test_rds2/test_rds2.py b/tests/test_rds2/test_rds2.py index a78657c09..dde046c61 100644 --- a/tests/test_rds2/test_rds2.py +++ b/tests/test_rds2/test_rds2.py @@ -331,6 +331,34 @@ def test_remove_tags_db(): len(result['ListTagsForResourceResponse']['ListTagsForResourceResult']['TagList']).should.equal(1) +@disable_on_py3() +@mock_rds2 +def test_add_tags_option_group(): + conn = boto.rds2.connect_to_region("us-west-2") + conn.create_option_group('test', 'mysql', '5.6', 'test option group') + result = conn.list_tags_for_resource('arn:aws:rds:us-west-2:1234567890:og:test') + list(result['ListTagsForResourceResponse']['ListTagsForResourceResult']['TagList']).should.have.length_of(0) + conn.add_tags_to_resource('arn:aws:rds:us-west-2:1234567890:og:test', + [('foo', 'fish'), ('foo2', 'bar2')]) + result = conn.list_tags_for_resource('arn:aws:rds:us-west-2:1234567890:og:test') + list(result['ListTagsForResourceResponse']['ListTagsForResourceResult']['TagList']).should.have.length_of(2) + + +@disable_on_py3() +@mock_rds2 +def test_remove_tags_option_group(): + conn = boto.rds2.connect_to_region("us-west-2") + conn.create_option_group('test', 'mysql', '5.6', 'test option group') + conn.add_tags_to_resource('arn:aws:rds:us-west-2:1234567890:og:test', + [('foo', 'fish'), ('foo2', 'bar2')]) + result = conn.list_tags_for_resource('arn:aws:rds:us-west-2:1234567890:og:test') + list(result['ListTagsForResourceResponse']['ListTagsForResourceResult']['TagList']).should.have.length_of(2) + conn.remove_tags_from_resource('arn:aws:rds:us-west-2:1234567890:og:test', + ['foo']) + result = conn.list_tags_for_resource('arn:aws:rds:us-west-2:1234567890:og:test') + list(result['ListTagsForResourceResponse']['ListTagsForResourceResult']['TagList']).should.have.length_of(1) + + #@disable_on_py3() #@mock_rds2 #def test_create_database_security_group():