@@ -98,7 +98,10 @@ def collect
98
98
struct . type = 'vpc'
99
99
struct . arn = "arn:aws:ec2:#{ @region } :#{ @account } :vpc/#{ vpc . vpc_id } " # no true ARN
100
100
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
+ } ] } )
102
105
. flow_logs . first . to_h
103
106
104
107
resources . push ( struct . to_h )
@@ -337,19 +340,33 @@ def collect
337
340
#
338
341
# describe_managed_prefix_lists
339
342
#
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 )
342
346
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
347
351
348
- resources . push ( struct . to_h )
352
+ resources . push ( struct . to_h )
353
+ end
349
354
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
350
359
end
351
360
end
352
361
353
362
resources
354
363
end
364
+
365
+ private
366
+
367
+ def suppressed_errors
368
+ %w[
369
+ InvalidAction
370
+ ]
371
+ end
355
372
end
0 commit comments