def __call__(self, i): if self.data.get('value_type') == 'resource_count': return self.process(i) matched = self.match(i) if matched and self.annotate: set_annotation(i, ANNOTATION_KEY, self.k) return matched
def __call__(self, alb): listeners = self.listener_map[alb['LoadBalancerArn']] if self.data.get('matched', False): listeners = alb.pop('c7n:MatchedListeners', []) found_listeners = False for listener in listeners: if self.match(listener): set_annotation(alb, 'c7n:MatchedListeners', listener) found_listeners = True return found_listeners
def process_bucket(self, b): acl = b.get('Acl', {'Grants': []}) if not acl or not acl['Grants']: return results = [] for grant in acl['Grants']: if 'URI' not in grant.get("Grantee", {}): continue if grant['Grantee']['URI'] in [self.AUTH_ALL, self.GLOBAL_ALL]: if grant['Permission'] == 'READ' and b['Website']: continue results.append(grant['Permission']) c = bucket_client(self.manager.session_factory(), b) if results: set_annotation(b, 'GlobalPermissions', results) return b
def __call__(self, r): instance = self.instance_map[r['Attachments'][0]['InstanceId']] if self.match(instance): r['Instance'] = instance set_annotation(r, ANNOTATION_KEY, "instance-%s" % self.k) return True
def __call__(self, i): matched = self.match(i) if matched and self.annotate: set_annotation(i, ANNOTATION_KEY, self.k) return matched