Class: Jets::Commands::Clean::Log
Instance Method Summary
collapse
#apigateway, #aws_lambda, #aws_options, #cfn, #dynamodb, #logs, #s3, #s3_resource, #sns, #sqs, #sts
#lookup, #stack_exists?, #stack_in_progress?
included
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
#clean ⇒ Object
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)
delete_log_group(g.log_group_name) unless @options[:noop]
say "Removed log group: #{g.log_group_name}"
end
say "Removed CloudWatch logs for #{prefix_guess}"
end
|
#clean_deploys ⇒ Object
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/jets/commands/clean/log.rb', line 32
def clean_deploys
groups = deploy_log_groups.sort_by do |g|
g.log_group_name
end
groups = groups[0..-3]
groups.each do |g|
logs.delete_log_group(log_group_name: g.log_group_name) unless @options[:noop]
end
end
|
#delete_log_group(log_group_name) ⇒ Object
28
29
30
|
# File 'lib/jets/commands/clean/log.rb', line 28
def delete_log_group(log_group_name)
logs.delete_log_group(log_group_name: log_group_name)
end
|
#deploy_log_groups ⇒ Object
43
44
45
46
47
48
|
# File 'lib/jets/commands/clean/log.rb', line 43
def deploy_log_groups
log_groups.select do |g|
!keep_log_group?(g.log_group_name) &&
g.log_group_name.include?('jets-base-path')
end
end
|