aws-sdk-utils 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/waf_util.rb +20 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7bcb9cd6ed38ebf703d00f256ef1cd81ddf76332
|
4
|
+
data.tar.gz: 0d334f6d7417d18d178b4fe8a62ee323da5b43da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe4c5b5095ad6817f6da5e33412ad626ce84a42ae92cddd81ce03a9e4fbb59a1fbf7d0c60a21d1f5f3fb28a68efbc8686459329f050220f7ce1b7d329c919bd9
|
7
|
+
data.tar.gz: 953ff6e31ad4e40586b4bc196cf74251d4712bbaacddb45ddc6b0c057d23d44c326292f3ca404fa11aaa072bece0a7e1042d6064f6bbabcc09cc3eb7c3c02834
|
data/lib/waf_util.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'aws-sdk'
|
2
|
+
|
3
|
+
module WafUtil
|
4
|
+
|
5
|
+
|
6
|
+
def self.get_ipset_id_by_name(ipset_name)
|
7
|
+
waf = Aws::WAF::Client.new
|
8
|
+
|
9
|
+
# short arm this - not going to have more than 100 any time this millenium
|
10
|
+
list_ip_sets_response = waf.list_ip_sets next_marker: nil,
|
11
|
+
limit: 100
|
12
|
+
|
13
|
+
found_ipset = list_ip_sets_response.ip_sets.select { |ip_set| ip_set.name == ipset_name }
|
14
|
+
if found_ipset.empty?
|
15
|
+
raise "ipset #{ipset_name} not found"
|
16
|
+
else
|
17
|
+
found_ipset.first.ip_set_id
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-sdk-utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- someguy
|
@@ -33,6 +33,7 @@ files:
|
|
33
33
|
- lib/aws-sdk-utils.rb
|
34
34
|
- lib/cloudformation_converger.rb
|
35
35
|
- lib/lambda_alias_switcher.rb
|
36
|
+
- lib/waf_util.rb
|
36
37
|
homepage: https://github.com/stelligent/aws-sdk-utils
|
37
38
|
licenses:
|
38
39
|
- MIT
|