Skip to content

Commit 158ebde

Browse files
llangeavram
authored andcommitted
Update tags_spec for Elasticache clusters and snapshots (#120)
* Update elasticache resources to generate proper arns * Update tags_spec for Elasticache clusters and snapshots We can now retrieve Elasticache clusters and snapshots tag list. This patch builds upon an existing patch from @gifflen : ryandub@95b90ae
1 parent e5b0c39 commit 158ebde

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

skew/resources/aws/elasticache.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,21 @@ class Meta(object):
2424
'CacheClusters[]', None)
2525
detail_spec = None
2626
id = 'CacheClusterId'
27+
tags_spec = ('list_tags_for_resource', 'TagList',
28+
'ResourceName', 'arn')
2729
filter_name = 'CacheClusterId'
2830
filter_type = 'scalar'
2931
name = 'CacheClusterId'
3032
date = 'CacheClusterCreateTime'
3133
dimension = 'CacheClusterId'
3234

35+
@property
36+
def arn(self):
37+
return 'arn:aws:%s:%s:%s:%s:%s' % (
38+
self._client.service_name,
39+
self._client.region_name,
40+
self._client.account_id, self.resourcetype, self.id)
41+
3342

3443
class SubnetGroup(AWSResource):
3544

@@ -55,8 +64,17 @@ class Meta(object):
5564
enum_spec = ('describe_snapshots', 'Snapshots', None)
5665
detail_spec = None
5766
id = 'SnapshotName'
67+
tags_spec = ('list_tags_for_resource', 'TagList',
68+
'ResourceName', 'arn')
5869
filter_name = 'SnapshotName'
5970
filter_type = 'scalar'
6071
name = 'SnapshotName'
6172
date = 'StartTime'
6273
dimension = None
74+
75+
@property
76+
def arn(self):
77+
return 'arn:aws:%s:%s:%s:%s:%s' % (
78+
self._client.service_name,
79+
self._client.region_name,
80+
self._client.account_id, self.resourcetype, self.id)

0 commit comments

Comments
 (0)