awspec 0.22.1 → 0.23.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.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -0
  3. data/doc/_resource_types/autoscaling_group.md +23 -0
  4. data/doc/_resource_types/cloudwatch_alarm.md +39 -0
  5. data/doc/_resource_types/directconnect_virtual_interface.md +30 -0
  6. data/doc/_resource_types/ebs.md +23 -0
  7. data/doc/_resource_types/ec2.md +61 -1
  8. data/doc/_resource_types/elasticache.md +47 -0
  9. data/doc/_resource_types/elasticache_cache_parameter_group.md +8 -0
  10. data/doc/_resource_types/elb.md +40 -0
  11. data/doc/_resource_types/iam_group.md +24 -0
  12. data/doc/_resource_types/iam_policy.md +39 -0
  13. data/doc/_resource_types/iam_role.md +16 -0
  14. data/doc/_resource_types/iam_user.md +24 -0
  15. data/doc/_resource_types/lambda.md +8 -0
  16. data/doc/_resource_types/network_acl.md +23 -2
  17. data/doc/_resource_types/rds.md +66 -0
  18. data/doc/_resource_types/rds_db_parameter_group.md +7 -0
  19. data/doc/_resource_types/route53_hosted_zone.md +25 -0
  20. data/doc/_resource_types/route_table.md +16 -0
  21. data/doc/_resource_types/s3.md +27 -0
  22. data/doc/_resource_types/security_group.md +8 -0
  23. data/doc/_resource_types/ses_identity.md +17 -0
  24. data/doc/_resource_types/subnet.md +15 -0
  25. data/doc/_resource_types/vpc.md +33 -0
  26. data/doc/resource_types.md +519 -72
  27. data/lib/awspec/generator/doc/type/directconnect_virtual_interface.rb +6 -2
  28. data/lib/awspec/generator/doc/type/ebs.rb +4 -2
  29. data/lib/awspec/generator/doc/type/ec2.rb +6 -2
  30. data/lib/awspec/generator/doc/type/elasticache.rb +7 -2
  31. data/lib/awspec/generator/doc/type/elb.rb +1 -1
  32. data/lib/awspec/generator/doc/type/network_acl.rb +4 -1
  33. data/lib/awspec/generator/doc/type/rds.rb +7 -2
  34. data/lib/awspec/generator/doc/type/s3.rb +1 -1
  35. data/lib/awspec/generator/doc/type/subnet.rb +4 -2
  36. data/lib/awspec/generator/doc/type/vpc.rb +4 -2
  37. data/lib/awspec/generator/template.rb +9 -4
  38. data/lib/awspec/helper/finder/s3.rb +6 -0
  39. data/lib/awspec/stub/iam_group.rb +9 -9
  40. data/lib/awspec/stub/iam_policy.rb +27 -0
  41. data/lib/awspec/stub/s3.rb +28 -0
  42. data/lib/awspec/type/directconnect_virtual_interface.rb +2 -2
  43. data/lib/awspec/type/ebs.rb +2 -2
  44. data/lib/awspec/type/ec2.rb +2 -2
  45. data/lib/awspec/type/elasticache.rb +2 -2
  46. data/lib/awspec/type/rds.rb +2 -2
  47. data/lib/awspec/type/s3.rb +19 -0
  48. data/lib/awspec/type/subnet.rb +2 -2
  49. data/lib/awspec/type/vpc.rb +2 -2
  50. data/lib/awspec/version.rb +1 -1
  51. metadata +14 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: aebd0e1b411d3474c554a32991af7f1860b1d699
4
- data.tar.gz: 9479622cd81a916645d61f992583f05e21e05000
3
+ metadata.gz: 29714cb2509f97ff68e7b273854fc1829a43161f
4
+ data.tar.gz: c6f75d467f1fbf92d96309a4e563aa356a6aee49
5
5
  SHA512:
6
- metadata.gz: 5acdb6a51a8439a90ba579fb3244a05c2cb65d16595aa5e08233196e469bfe40f697067fc650f1054a9d4980ef4615ccce512469a7c9d5738ab3b227e5d615ff
7
- data.tar.gz: b0f24b98bcc8f2f4604c67f5e01682c09d2d4d604afa97168dbe53d3b52b9add6b5e69a46303c174c624aea1833cc837dc7febea840899a4d2ca79266e42b292
6
+ metadata.gz: 345ee0b436e56b86b65d784738a745a9addb2913fb0b63b981c04cb13e48ea3e483a190ce524c5aa2d96cd8ea630422b916c5fb4ae94b56852b60b11abf9683a
7
+ data.tar.gz: b0c9ad16b2b6aa41c83189f42ea8b6df451f6965eac01c665f77847d12787e8694d3291953e5524c02162ccea13c1dd6e807271c8e4a8cfcc79de7c5379c54f6
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # awspec [![Gem](https://img.shields.io/gem/v/awspec.svg)](https://rubygems.org/gems/awspec) [![Travis](https://img.shields.io/travis/k1LoW/awspec.svg)](https://travis-ci.org/k1LoW/awspec) [![Scrutinizer](https://img.shields.io/scrutinizer/g/k1LoW/awspec.svg)](https://scrutinizer-ci.com/g/k1LoW/awspec/) [![Gemnasium](https://img.shields.io/gemnasium/k1LoW/awspec.svg)](https://gemnasium.com/k1LoW/awspec)
2
2
 
3
+ [![Join the chat at https://gitter.im/k1LoW/awspec](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/k1LoW/awspec?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
4
+
3
5
  RSpec tests for your AWS resources.
4
6
 
5
7
  [Resource Types](doc/resource_types.md) | [Contributing](doc/contributing.md)
@@ -0,0 +1,23 @@
1
+ ### exist
2
+
3
+ ```ruby
4
+ describe autoscaling_group('my-auto-scaling-group') do
5
+ it { should exist }
6
+ end
7
+ ```
8
+
9
+ ### have_ec2
10
+
11
+ ```ruby
12
+ describe autoscaling_group('my-auto-scaling-group') do
13
+ it { should have_ec2('my-ec2') }
14
+ end
15
+ ```
16
+
17
+ ### have_elb
18
+
19
+ ```ruby
20
+ describe autoscaling_group('my-auto-scaling-group') do
21
+ it { should have_elb('my-elb') }
22
+ end
23
+ ```
@@ -0,0 +1,39 @@
1
+ ### exist
2
+
3
+ ```ruby
4
+ describe cloudwatch_alarm('my-cloudwatch-alarm') do
5
+ it { should exist }
6
+ end
7
+ ```
8
+
9
+ ### have_alarm_action
10
+
11
+ ```ruby
12
+ describe cloudwatch_alarm('my-cloudwatch-alarm') do
13
+ it { should have_alarm_action('arn:aws:sns:ap-northeast-1:1234567890:sns_alert') }
14
+ end
15
+ ```
16
+
17
+ ### have_insufficient_data_action
18
+
19
+ ```ruby
20
+ describe cloudwatch_alarm('my-cloudwatch-alarm') do
21
+ it { should have_insufficient_data_action('arn:aws:sns:ap-northeast-1:1234567890:sns_alert') }
22
+ end
23
+ ```
24
+
25
+ ### have_ok_action
26
+
27
+ ```ruby
28
+ describe cloudwatch_alarm('my-cloudwatch-alarm') do
29
+ it { should have_ok_action('arn:aws:sns:ap-northeast-1:1234567890:sns_alert') }
30
+ end
31
+ ```
32
+
33
+ ### belong_to_metric
34
+
35
+ ```ruby
36
+ describe cloudwatch_alarm('my-cloudwatch-alarm') do
37
+ it { should belong_to_metric('NumberOfProcesses').namespace('my-cloudwatch-namespace') }
38
+ end
39
+ ```
@@ -0,0 +1,30 @@
1
+ ### first
2
+
3
+ ```ruby
4
+ describe directconnect_virtual_interface('my-directconnect-virtual-interface') do
5
+ it { should exist }
6
+ it { should be_available }
7
+ its(:connection_id) { should eq 'dxcon-abcd5fgh' }
8
+ its(:virtual_interface_id) { should eq 'dxvif-aabbccdd' }
9
+ its(:amazon_address) { should eq '170.252.252.1/30' }
10
+ its(:customer_address) { should eq '123.456.789.2/30' }
11
+ its(:virtual_gateway_id) { should eq 'vgw-d234e5f6' }
12
+ end
13
+ ```
14
+
15
+ ### exist
16
+
17
+ ```ruby
18
+ describe directconnect_virtual_interface('my-directconnect-virtual-interface') do
19
+ it { should exist }
20
+ end
21
+ ```
22
+
23
+ ### be_confirming, be_verifying, be_pending, be_available, be_deleting, be_deleted, be_rejected
24
+
25
+ ```ruby
26
+ describe directconnect_virtual_interface('my-directconnect-virtual-interface') do
27
+ it { should exist }
28
+ it { should be_available }
29
+ end
30
+ ```
@@ -0,0 +1,23 @@
1
+ ### exist
2
+
3
+ ```ruby
4
+ describe ebs('my-volume') do
5
+ it { should exist }
6
+ end
7
+ ```
8
+
9
+ ### be_attached_to
10
+
11
+ ```ruby
12
+ describe ebs('my-volume') do
13
+ it { should be_attached_to('my-ec2') }
14
+ end
15
+ ```
16
+
17
+ ### be_creating, be_available, be_in_use, be_deleting, be_deleted, be_error
18
+
19
+ ```ruby
20
+ describe ebs('my-volume') do
21
+ it { should be_in_use }
22
+ end
23
+ ```
@@ -6,10 +6,70 @@ describe ec2('my-ec2') do
6
6
  end
7
7
  ```
8
8
 
9
- ### be_running
9
+ ### be_disabled_api_termination
10
+
11
+ ```ruby
12
+ describe ec2('my-ec2') do
13
+ it { should be_disabled_api_termination }
14
+ end
15
+ ```
16
+
17
+ ### be_pending
18
+
19
+ ```ruby
20
+ describe ec2('my-ec2') do
21
+ it { should be_pending }
22
+ end
23
+ ```
24
+
25
+ ### be_pending, be_running, be_shutting_down, be_terminated, be_stopping, be_stopped
10
26
 
11
27
  ```ruby
12
28
  describe ec2('my-ec2') do
13
29
  it { should be_running }
14
30
  end
15
31
  ```
32
+
33
+ ### have_ebs
34
+
35
+ ```ruby
36
+ describe ec2('my-ec2') do
37
+ it { should have_ebs('vol-123a123b') }
38
+ it { should have_ebs('my-volume') }
39
+ end
40
+ ```
41
+
42
+ ### have_eip
43
+
44
+ ```ruby
45
+ describe ec2('my-ec2') do
46
+ it { should have_eip('123.0.456.789') }
47
+ end
48
+ ```
49
+
50
+ ### have_security_group
51
+
52
+ ```ruby
53
+ describe ec2('my-ec2') do
54
+ it { should have_security_group('my-security-group-name') }
55
+ it { should have_security_group('sg-1a2b3cd4') }
56
+ end
57
+ ```
58
+
59
+ ### belong_to_subnet
60
+
61
+ ```ruby
62
+ describe ec2('my-ec2') do
63
+ it { should belong_to_subnet('subnet-1234a567') }
64
+ it { should belong_to_subnet('my-subnet') }
65
+ end
66
+ ```
67
+
68
+ ### belong_to_vpc
69
+
70
+ ```ruby
71
+ describe ec2('my-ec2') do
72
+ it { should belong_to_vpc('vpc-ab123cde') }
73
+ it { should belong_to_vpc('my-vpc') }
74
+ end
75
+ ```
@@ -0,0 +1,47 @@
1
+ ### exist
2
+
3
+ ```ruby
4
+ describe elasticache('my-rep-group-001') do
5
+ it { should exist }
6
+ end
7
+ ```
8
+
9
+ ### be_available, be_creating, be_deleted, be_deleting, be_incompatible_network, be_modifying, be_rebooting_cache_cluster_nodes, be_restore_failed, be_snapshotting
10
+
11
+ ```ruby
12
+ describe elasticache('my-rep-group-001') do
13
+ it { should be_available }
14
+ end
15
+ ```
16
+
17
+ ### have_cache_parameter_group
18
+
19
+ ```ruby
20
+ describe elasticache('my-rep-group-001') do
21
+ it { should have_cache_parameter_group('my-cache-parameter-group') }
22
+ end
23
+ ```
24
+
25
+ ### belong_to_cache_subnet_group
26
+
27
+ ```ruby
28
+ describe elasticache('my-rep-group-001') do
29
+ it { should belong_to_cache_subnet_group('my-cache-subnet-group') }
30
+ end
31
+ ```
32
+
33
+ ### belong_to_replication_group
34
+
35
+ ```ruby
36
+ describe elasticache('my-rep-group-001') do
37
+ it { should belong_to_replication_group('my-rep-group') }
38
+ end
39
+ ```
40
+
41
+ ### belong_to_vpc
42
+
43
+ ```ruby
44
+ describe elasticache('my-rep-group-001') do
45
+ it { should belong_to_vpc('my-vpc') }
46
+ end
47
+ ```
@@ -7,3 +7,11 @@ describe elasticache_cache_parameter_group('my-cache-parameter-group') do
7
7
  its(:client_output_buffer_limit_pubsub_hard_limit) { should eq '33554432' }
8
8
  end
9
9
  ```
10
+
11
+ ### exist
12
+
13
+ ```ruby
14
+ describe elasticache_cache_parameter_group('my-cache-parameter-group') do
15
+ it { should exist }
16
+ end
17
+ ```
@@ -1,3 +1,19 @@
1
+ ### exist
2
+
3
+ ```ruby
4
+ describe elb('my-elb') do
5
+ it { should exist }
6
+ end
7
+ ```
8
+
9
+ ### have_ec2
10
+
11
+ ```ruby
12
+ describe elb('my-elb') do
13
+ it { should have_ec2('my-ec2') }
14
+ end
15
+ ```
16
+
1
17
  ### have_listener
2
18
 
3
19
  http://docs.aws.amazon.com/en_us/ElasticLoadBalancing/latest/DeveloperGuide/elb-listener-config.html
@@ -7,3 +23,27 @@ describe elb('my-elb') do
7
23
  it { should have_listener(protocol: 'HTTPS', port: 443, instance_protocol: 'HTTP', instance_port: 80) }
8
24
  end
9
25
  ```
26
+
27
+ ### have_security_group
28
+
29
+ ```ruby
30
+ describe elb('my-elb') do
31
+ it { should have_security_group('my-lb-security-group-tag-name') }
32
+ end
33
+ ```
34
+
35
+ ### have_subnet
36
+
37
+ ```ruby
38
+ describe elb('my-elb') do
39
+ it { should have_subnet('my-subnet') }
40
+ end
41
+ ```
42
+
43
+ ### belong_to_vpc
44
+
45
+ ```ruby
46
+ describe elb('my-elb') do
47
+ it { should belong_to_vpc('my-vpc') }
48
+ end
49
+ ```
@@ -1,3 +1,11 @@
1
+ ### exist
2
+
3
+ ```ruby
4
+ describe iam_group('my-iam-group') do
5
+ it { should exist }
6
+ end
7
+ ```
8
+
1
9
  ### be_allowed_action
2
10
 
3
11
  ```ruby
@@ -6,3 +14,19 @@ describe iam_group('my-iam-group') do
6
14
  it { should be_allowed_action('s3:Put*').resource_arn('arn:aws:s3:::my-bucket-name/*') }
7
15
  end
8
16
  ```
17
+
18
+ ### have_iam_policy
19
+
20
+ ```ruby
21
+ describe iam_group('my-iam-group') do
22
+ it { should have_iam_policy('ReadOnlyAccess') }
23
+ end
24
+ ```
25
+
26
+ ### have_iam_user
27
+
28
+ ```ruby
29
+ describe iam_group('my-iam-group') do
30
+ it { should have_iam_user('my-iam-user') }
31
+ end
32
+ ```
@@ -0,0 +1,39 @@
1
+ ### exist
2
+
3
+ ```ruby
4
+ describe iam_policy('my-iam-policy') do
5
+ it { should exist }
6
+ end
7
+ ```
8
+
9
+ ### be_attachable
10
+
11
+ ```ruby
12
+ describe iam_policy('my-iam-policy') do
13
+ it { should be_attachable }
14
+ end
15
+ ```
16
+
17
+ ### be_attached_to_group
18
+
19
+ ```ruby
20
+ describe iam_policy('my-iam-policy') do
21
+ it { should be_attached_to_group('my-iam-group') }
22
+ end
23
+ ```
24
+
25
+ ### be_attached_to_role
26
+
27
+ ```ruby
28
+ describe iam_policy('my-iam-policy') do
29
+ it { should be_attached_to_role('HelloIAmGodRole') }
30
+ end
31
+ ```
32
+
33
+ ### be_attached_to_user
34
+
35
+ ```ruby
36
+ describe iam_policy('my-iam-policy') do
37
+ it { should be_attached_to_policy('my-iam-policy') }
38
+ end
39
+ ```
@@ -1,3 +1,11 @@
1
+ ### exist
2
+
3
+ ```ruby
4
+ describe iam_role('my-iam-role') do
5
+ it { should exist }
6
+ end
7
+ ```
8
+
1
9
  ### be_allowed_action
2
10
 
3
11
  ```ruby
@@ -6,3 +14,11 @@ describe iam_role('my-iam-role') do
6
14
  it { should be_allowed_action('s3:Put*').resource_arn('arn:aws:s3:::my-bucket-name/*') }
7
15
  end
8
16
  ```
17
+
18
+ ### have_iam_policy
19
+
20
+ ```ruby
21
+ describe iam_role('my-iam-role') do
22
+ it { should have_iam_policy('ReadOnlyAccess') }
23
+ end
24
+ ```
@@ -1,3 +1,11 @@
1
+ ### exist
2
+
3
+ ```ruby
4
+ describe iam_user('my-iam-user') do
5
+ it { should exist }
6
+ end
7
+ ```
8
+
1
9
  ### be_allowed_action
2
10
 
3
11
  ```ruby
@@ -6,3 +14,19 @@ describe iam_user('my-iam-user') do
6
14
  it { should be_allowed_action('s3:Put*').resource_arn('arn:aws:s3:::my-bucket-name/*') }
7
15
  end
8
16
  ```
17
+
18
+ ### have_iam_policy
19
+
20
+ ```ruby
21
+ describe iam_user('my-iam-user') do
22
+ it { should have_iam_policy('ReadOnlyAccess') }
23
+ end
24
+ ```
25
+
26
+ ### belong_to_iam_group
27
+
28
+ ```ruby
29
+ describe iam_user('my-iam-user') do
30
+ it { should belong_to_iam_group('my-iam-group') }
31
+ end
32
+ ```