awsrm 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fdb234bc497f55013b98bea559390ecef21d4386
4
- data.tar.gz: c24052f35f10cc18dd15199b0594dbf1e90a9fce
3
+ metadata.gz: f893ab211cad965de8a1700ecefd98066d19c164
4
+ data.tar.gz: 2eef0c73cb4880f2d1e430b0c0928bb7cdc8e4be
5
5
  SHA512:
6
- metadata.gz: 6f95786cc4e005744fcf2a09cb05d1f284a879da8e34763157fedf614002b5fbc95360cea64d8e56048080830926e53766c38d4e3694d0f5afa11526df55cb1a
7
- data.tar.gz: 3dc6360f0d025ca8e86114e200242932918862531c692e89e2ef0943a97dd6c5b87d51472bf02e6aa604fa7a02ff279e947ce7972972355da24eacfbc2e98abe
6
+ metadata.gz: 981bb8adb36cb0d1d52f51f48752185e0a6c654053cfff3c3090aab05549e75ba3a738946b1bcba894b85d11d74343df4cf633c3bbc6dbf119a013322f973b0f
7
+ data.tar.gz: 2ffb08a9e4e615e44443a2733fbd37228caad2d31cb1c1c29814d9369ccf3ab1b03bf54089c7ab6b9f5bb58f64045bb81cc045041f5c1eb9025adb0bde0fbe98
@@ -8,6 +8,7 @@
8
8
  | [Elb](#elb)
9
9
  | [NetworkAcl](#network_acl)
10
10
  | [RouteTable](#route_table)
11
+ | [SecurityGroup](#security_group)
11
12
  | [Subnet](#subnet)
12
13
  | [Vpc](#vpc)
13
14
  | [VpnConnection](#vpn_connection)
@@ -115,6 +116,19 @@
115
116
  | vpc | [`#<Proc>`](https://github.com/k1LoW/awsrm/blob/master/lib/awsrm/resources/route_table.rb) |
116
117
 
117
118
 
119
+ ## <a name="security_group">Awsrm::SecurityGroup</a>
120
+
121
+ ### Filter
122
+
123
+ | key | replaced filter |
124
+ | - | - |
125
+ | id | `group-id` |
126
+ | name | `tag:Name` |
127
+ | cidr | `cidrBlock` |
128
+ | vpc_id | `vpc-id` |
129
+ | vpc | [`#<Proc>`](https://github.com/k1LoW/awsrm/blob/master/lib/awsrm/resources/security_group.rb) |
130
+
131
+
118
132
  ## <a name="subnet">Awsrm::Subnet</a>
119
133
 
120
134
  ### Filter
@@ -10,6 +10,7 @@ require 'awsrm/resources/elb'
10
10
  require 'awsrm/resources/route_table'
11
11
  require 'awsrm/resources/subnet'
12
12
  require 'awsrm/resources/network_acl'
13
+ require 'awsrm/resources/security_group'
13
14
  require 'awsrm/resources/vpc'
14
15
  require 'awsrm/resources/vpn_connection'
15
16
  require 'awsrm/version'
@@ -0,0 +1,28 @@
1
+ module Awsrm
2
+ class SecurityGroup < Awsrm::Resource
3
+ FILTER_MAP = {
4
+ id: 'group-id',
5
+ name: 'tag:Name',
6
+ cidr: 'cidrBlock',
7
+ vpc_id: 'vpc-id',
8
+ vpc: ->(value) { { name: 'vpc-id', values: [Awsrm::Vpc.one(name: value).id] } }
9
+ }.freeze
10
+
11
+ class << self
12
+ def all(params)
13
+ res = ec2_client.describe_security_groups(
14
+ filters: filters(params)
15
+ )
16
+ res.security_groups.map do |sg|
17
+ SecurityGroupReader.new(sg)
18
+ end
19
+ end
20
+ end
21
+ end
22
+
23
+ class SecurityGroupReader < Awsrm::ResourceReader
24
+ def id
25
+ @resource.group_id
26
+ end
27
+ end
28
+ end
@@ -1,3 +1,3 @@
1
1
  module Awsrm
2
- VERSION = '0.6.0'.freeze
2
+ VERSION = '0.7.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awsrm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - k1LoW
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-07-13 00:00:00.000000000 Z
11
+ date: 2018-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk
@@ -188,6 +188,7 @@ files:
188
188
  - lib/awsrm/resources/elb.rb
189
189
  - lib/awsrm/resources/network_acl.rb
190
190
  - lib/awsrm/resources/route_table.rb
191
+ - lib/awsrm/resources/security_group.rb
191
192
  - lib/awsrm/resources/subnet.rb
192
193
  - lib/awsrm/resources/vpc.rb
193
194
  - lib/awsrm/resources/vpn_connection.rb