Exemplo 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
Exemplo 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
Exemplo 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
Exemplo 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
Exemplo 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
Exemplo 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
Exemplo 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
Exemplo 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
Exemplo 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
Exemplo 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