Class: Jets::Commands::Clean::Log

Inherits:
Base
  • Object
show all
Extended by:
Memoist
Includes:
AwsServices
Defined in:
lib/jets/commands/clean/log.rb

Instance Method Summary collapse

Methods included from AwsServices

#cfn, #lambda, #logs, #s3, #s3_resource, #stack_exists?, #stack_in_progress?, #sts

Methods inherited from Base

autocomplete, banner, dispatch, eager_load!, help_list, inherited, klass_from_namespace, namespace_from_class, namespaced_commands, perform, subclasses

Instance Method Details

#cleanObject



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/jets/commands/clean/log.rb', line 16

def clean
  are_you_sure?("delete CloudWatch logs")

  say "Removing CloudWatch logs for #{prefix_guess}..."
  log_groups.each do |g|
    next if keep_log_group?(g.log_group_name)
    logs.delete_log_group(log_group_name: g.log_group_name) unless @options[:noop]
    say "Removed log group: #{g.log_group_name}"
  end
  say "Removed CloudWatch logs for #{prefix_guess}"
end