def get_lambda_sgs(self): sg_ids = set() from c7n.resources.awslambda import AWSLambda for func in AWSLambda(self.manager.ctx, {}).resources(): if 'VpcConfig' not in func: continue for g in func['VpcConfig']['SecurityGroupIds']: sg_ids.add(g) return sg_ids
def scan_lambda_roles(self): from c7n.resources.awslambda import AWSLambda manager = AWSLambda(self.manager.ctx, {}) return [r['Role'] for r in manager.resources() if 'Role' in r]