1
+ # frozen_string_literal: true
2
+
3
+ #
4
+ # Collect Glue resources
5
+ #
6
+ class Glue < Mapper
7
+ #
8
+ # Returns an array of resources.
9
+ #
10
+ def collect
11
+ resources = [ ]
12
+ #
13
+ # get_data_catalog_encryption_settings
14
+ #
15
+ @client . get_data_catalog_encryption_settings . each_with_index do | response , page |
16
+ log ( response . context . operation_name , page )
17
+
18
+ struct = OpenStruct . new ( response . to_h )
19
+ struct . type = 'catalog_encryption_settings'
20
+ struct . arn = "arn:aws:glue:#{ @region } :#{ @account } :data-catalog-encryption-settings" # no true ARN
21
+ resources . push ( struct . to_h )
22
+ end
23
+
24
+ #
25
+ # get_security_configurations
26
+ #
27
+ @client . get_security_configurations . each_with_index do | response , page |
28
+ log ( response . context . operation_name , page )
29
+
30
+ response . security_configurations . each do | security_configuration |
31
+ struct = OpenStruct . new ( security_configuration . to_h )
32
+ struct . type = 'security_configuration'
33
+ struct . arn = "arn:aws:glue:#{ @region } :#{ @account } :security-configuration/#{ security_configuration . name } " # no true ARN
34
+ resources . push ( struct . to_h )
35
+ end
36
+ end
37
+
38
+ #
39
+ # get_jobs
40
+ #
41
+ @client . get_jobs . each_with_index do | response , page |
42
+ log ( response . context . operation_name , page )
43
+
44
+ response . jobs . each do | job |
45
+ struct = OpenStruct . new ( job . to_h )
46
+ struct . type = 'job'
47
+ struct . arn = "arn:aws:glue:#{ @region } :#{ @account } :job/#{ job . name } "
48
+ resources . push ( struct . to_h )
49
+ end
50
+ end
51
+
52
+ #
53
+ # get_dev_endpoints
54
+ #
55
+ @client . get_dev_endpoints . each_with_index do | response , page |
56
+ log ( response . context . operation_name , page )
57
+
58
+ response . dev_endpoints . each do | dev_endpoint |
59
+ struct = OpenStruct . new ( dev_endpoint . to_h )
60
+ struct . type = 'dev_endpoint'
61
+ struct . arn = "arn:aws:glue:#{ @region } :#{ @account } :devEndpoint/#{ dev_endpoint . endpoint_name } "
62
+ resources . push ( struct . to_h )
63
+ end
64
+ end
65
+
66
+ #
67
+ # get_crawlers
68
+ #
69
+ @client . get_crawlers . each_with_index do | response , page |
70
+ log ( response . context . operation_name , page )
71
+
72
+ response . crawlers . each do | crawler |
73
+ struct = OpenStruct . new ( crawler . to_h )
74
+ struct . type = 'crawler'
75
+ struct . arn = "arn:aws:glue:#{ @region } :#{ @account } :crawler/#{ crawler . name } "
76
+ resources . push ( struct . to_h )
77
+ end
78
+ end
79
+
80
+ #
81
+ # get_connections
82
+ #
83
+ @client . get_connections . each_with_index do | response , page |
84
+ log ( response . context . operation_name , page )
85
+
86
+ response . connection_list . each do | connection |
87
+ struct = OpenStruct . new ( connection . to_h )
88
+ struct . type = 'connection'
89
+ struct . arn = "arn:aws:glue:#{ @region } :#{ @account } :connection/#{ connection . name } "
90
+ resources . push ( struct . to_h )
91
+ end
92
+ end
93
+ resources
94
+ end
95
+
96
+ end
97
+
0 commit comments