def _delete_logs(self, resources_info: Dict): cloudwatch_logs = CloudWatchLogs(resources_info) log_group_name = cloudwatch_logs.get_log_group_name( resources_info.get('lambda').get('name')) response = cloudwatch_logs.delete_log_group(log_group_name) response_parser.parse_delete_log_response( response, log_group_name, self.scar_info.get('cli_output'))
def _create_log_group(self, resources_info: Dict) -> None: cloudwatch_logs = CloudWatchLogs(resources_info) response = cloudwatch_logs.create_log_group() response_parser.parse_log_group_creation_response( response, cloudwatch_logs.get_log_group_name(), self.scar_info.get('cli_output'))
def test_get_log_group_name(self): cwl = CloudWatchLogs({'lambda': {'name': 'fname'}}) self.assertEqual(cwl.get_log_group_name(), '/aws/lambda/fname')