Skip to content

Commit 0c400a5

Browse files
authored
Merge pull request #139 from darkbitio/build
Build
2 parents 9abdbd0 + 065a1c6 commit 0c400a5

File tree

2 files changed

+26
-9
lines changed

2 files changed

+26
-9
lines changed

lib/aws_recon/collectors/ec2.rb

+25-8
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,10 @@ def collect
9898
struct.type = 'vpc'
9999
struct.arn = "arn:aws:ec2:#{@region}:#{@account}:vpc/#{vpc.vpc_id}" # no true ARN
100100
struct.flow_logs = @client
101-
.describe_flow_logs({ filter: [{ name: 'resource-id', values: [vpc.vpc_id] }] })
101+
.describe_flow_logs({ filter: [{
102+
name: 'resource-id',
103+
values: [vpc.vpc_id]
104+
}] })
102105
.flow_logs.first.to_h
103106

104107
resources.push(struct.to_h)
@@ -337,19 +340,33 @@ def collect
337340
#
338341
# describe_managed_prefix_lists
339342
#
340-
@client.describe_managed_prefix_lists.each_with_index do |response, page|
341-
log(response.context.operation_name, page)
343+
begin
344+
@client.describe_managed_prefix_lists.each_with_index do |response, page|
345+
log(response.context.operation_name, page)
342346

343-
response.prefix_lists.each do |list|
344-
struct = OpenStruct.new(list.to_h)
345-
struct.type = 'prefix_list'
346-
struct.arn = list.prefix_list_arn
347+
response.prefix_lists.each do |list|
348+
struct = OpenStruct.new(list.to_h)
349+
struct.type = 'prefix_list'
350+
struct.arn = list.prefix_list_arn
347351

348-
resources.push(struct.to_h)
352+
resources.push(struct.to_h)
353+
end
349354
end
355+
rescue Aws::EC2::Errors::ServiceError => e
356+
log_error(e.code)
357+
358+
raise e unless suppressed_errors.include?(e.code) && !@options.quit_on_exception
350359
end
351360
end
352361

353362
resources
354363
end
364+
365+
private
366+
367+
def suppressed_errors
368+
%w[
369+
InvalidAction
370+
]
371+
end
355372
end

lib/aws_recon/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module AwsRecon
2-
VERSION = "0.5.19"
2+
VERSION = "0.5.20"
33
end

0 commit comments

Comments
 (0)