awspec 0.10.2 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 735ac3ea11197e0d21958bd387af953a77720760
4
- data.tar.gz: 177f17845d8acacc5fc45e541dad53f4333109b0
3
+ metadata.gz: 16910d9cda734c86c840666374dc2c4b76879fbb
4
+ data.tar.gz: 4155b14d91f07184993c5ae95e7a4145ac00ff04
5
5
  SHA512:
6
- metadata.gz: e8506223f8805c9daa7001cc9d5c2ffeb57fca18c02df41e4af06bfe88b305c8f7ea66bb7f20058c272e0749507297cff3ef7b0fb7612958a16dcc0f37587c88
7
- data.tar.gz: 69f5c5c2289aab357c3479f0a08b4f48721dea1eb3c41f136d503c7d866cb2ef240beaf8eba68badc5467c21090cbf6aacec3cb172c9f32f3ccb6ceb3c45b49e
6
+ metadata.gz: d2ebfcdabd2c5bc3510d267d8078c103af3342a616af6c73f32eaf1759799eba171b07161d33b31e9e7d38d16887f66663a210dde5ba8e552f850cb9dc62ff55
7
+ data.tar.gz: 134eb310c685f2a8fdc7686d54f6b1f2ae85996fc3e2d71f475e8d7e6a332b724c7720454c1598c16802a5371957d031784c5bff722053aac394f87d3ec69c41
data/README.md CHANGED
@@ -60,6 +60,7 @@ describe ec2('my-ec2-tag-name') do
60
60
  it { should belong_to_vpc('my-vpc') }
61
61
  it { should belong_to_subnet('subnet-1234a567') }
62
62
  it { should have_eip('123.0.456.789') }
63
+ it { should be_disabled_api_termination }
63
64
  end
64
65
  ```
65
66
 
@@ -31,6 +31,8 @@ end
31
31
  ```
32
32
 
33
33
 
34
+ ### be_disabled_api_termination
35
+
34
36
  ### be_pending
35
37
 
36
38
  ### be_running
@@ -36,6 +36,12 @@ module Awspec::Helper
36
36
  res[:reservations].first[:instances].count == 1
37
37
  end
38
38
 
39
+ def find_ec2_attribute(id, attribute)
40
+ res = @ec2_client.describe_instance_attribute({
41
+ instance_id: id, attribute: attribute
42
+ })
43
+ end
44
+
39
45
  def find_subnet(subnet_id)
40
46
  res = @ec2_client.describe_subnets({
41
47
  filters: [{ name: 'subnet-id', values: [subnet_id] }]
@@ -40,6 +40,12 @@ Aws.config[:ec2] = {
40
40
  }
41
41
  ]
42
42
  },
43
+ describe_instance_attribute: {
44
+ instance_id: 'i-ec12345a',
45
+ disable_api_termination: {
46
+ value: true
47
+ }
48
+ },
43
49
  describe_vpcs: {
44
50
  vpcs: [
45
51
  {
@@ -37,7 +37,7 @@ Aws.config[:iam] = {
37
37
  }
38
38
  ],
39
39
  is_truncated: false,
40
- maker: nil
40
+ marker: nil
41
41
  }
42
42
  }
43
43
  }
@@ -17,7 +17,7 @@ Aws.config[:iam] = {
17
17
  }
18
18
  ],
19
19
  is_truncated: false,
20
- maker: nil
20
+ marker: nil
21
21
  }
22
22
  }
23
23
  }
@@ -28,7 +28,7 @@ Aws.config[:iam] = {
28
28
  }
29
29
  ],
30
30
  is_truncated: false,
31
- maker: nil
31
+ marker: nil
32
32
  }
33
33
  }
34
34
  }
@@ -20,6 +20,11 @@ module Awspec::Type
20
20
  end
21
21
  end
22
22
 
23
+ def disabled_api_termination?
24
+ ret = find_ec2_attribute(@id, 'disableApiTermination')
25
+ ret[:disable_api_termination][:value]
26
+ end
27
+
23
28
  def has_eip?(ip_address = nil)
24
29
  option = {
25
30
  filters: [{ name: 'instance-id', values: [@id] }]
@@ -5,18 +5,17 @@ module Awspec::Type
5
5
  def initialize(name)
6
6
  super
7
7
  @parameters = {}
8
+ res = @rds_client.describe_db_parameters({
9
+ db_parameter_group_name: name
10
+ })
8
11
 
9
- marker = nil
10
- while @parameters.empty? || !marker.nil?
11
- res = @rds_client.describe_db_parameters(
12
- db_parameter_group_name: name,
13
- marker: marker)
14
- marker = res.marker
15
- break if res.parameters.empty?
12
+ loop do
16
13
  res.parameters.each do |param|
17
14
  @parameters[param.parameter_name] = param.parameter_value
18
15
  end
16
+ (res.next_page? && res = res.next_page) || break
19
17
  end
18
+
20
19
  @id = name unless @parameters.empty?
21
20
  @resource = @parameters
22
21
  end
@@ -1,3 +1,3 @@
1
1
  module Awspec
2
- VERSION = '0.10.2'
2
+ VERSION = '0.11.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.2
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - k1LoW
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-10 00:00:00.000000000 Z
11
+ date: 2015-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec