Esempio n. 1
0
    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
Esempio n. 2
0
    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
Esempio n. 3
0
    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
Esempio n. 4
0
    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
Esempio n. 5
0
    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
Esempio n. 6
0
    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
Esempio n. 7
0
 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
Esempio n. 8
0
 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
Esempio n. 9
0
 def __call__(self, i):
     matched = self.match(i)
     if matched and self.annotate:
         set_annotation(i, ANNOTATION_KEY, self.k)
     return matched
Esempio n. 10
0
 def __call__(self, i):
     matched = self.match(i)
     if matched and self.annotate:
         set_annotation(i, ANNOTATION_KEY, self.k)
     return matched