stackup 0.1.0 → 0.2.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 (44) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +12 -12
  3. data/README.md +38 -15
  4. data/bin/stackup +76 -34
  5. data/doc/Stackup/ErrorMappingProxy.html +378 -0
  6. data/doc/Stackup/InvalidStateError.html +142 -0
  7. data/doc/Stackup/NoSuchStack.html +142 -0
  8. data/doc/Stackup/NoUpdateRequired.html +134 -0
  9. data/doc/Stackup/Service.html +399 -0
  10. data/doc/Stackup/ServiceError.html +138 -0
  11. data/doc/Stackup/Stack.html +1269 -0
  12. data/doc/Stackup/StackUpdateError.html +142 -0
  13. data/doc/Stackup/StackWatcher.html +455 -0
  14. data/doc/Stackup.html +202 -0
  15. data/doc/_index.html +199 -0
  16. data/doc/class_list.html +58 -0
  17. data/doc/css/common.css +1 -0
  18. data/doc/css/full_list.css +57 -0
  19. data/doc/css/style.css +339 -0
  20. data/doc/file.README.html +143 -0
  21. data/doc/file_list.html +60 -0
  22. data/doc/frames.html +26 -0
  23. data/doc/index.html +143 -0
  24. data/doc/js/app.js +219 -0
  25. data/doc/js/full_list.js +181 -0
  26. data/doc/js/jquery.js +4 -0
  27. data/doc/method_list.html +195 -0
  28. data/doc/top-level-namespace.html +194 -0
  29. data/lib/stackup/error_mapping_proxy.rb +37 -0
  30. data/lib/stackup/errors.rb +9 -6
  31. data/lib/stackup/service.rb +39 -0
  32. data/lib/stackup/stack.rb +52 -59
  33. data/lib/stackup/stack_watcher.rb +16 -10
  34. data/lib/stackup.rb +26 -0
  35. data/spec/spec_helper.rb +15 -1
  36. data/spec/stackup/stack_spec.rb +114 -48
  37. data/spec/stackup/stack_watcher_spec.rb +20 -15
  38. data/stackup.gemspec +1 -1
  39. data/woollyams/template.json +44 -0
  40. metadata +29 -6
  41. data/pkg/stackup-0.0.1.gem +0 -0
  42. data/pkg/stackup-0.0.8.gem +0 -0
  43. data/pkg/stackup-0.0.9.gem +0 -0
  44. data/woollyams/sample-template.json +0 -79
@@ -1,5 +1,6 @@
1
1
  require "spec_helper"
2
2
 
3
+ require "aws-sdk-resources"
3
4
  require "stackup/stack_watcher"
4
5
 
5
6
  describe Stackup::StackWatcher do
@@ -19,12 +20,20 @@ describe Stackup::StackWatcher do
19
20
  @event_id += 1
20
21
  end
21
22
 
23
+ def new_event_reasons
24
+ [].tap do |result|
25
+ subject.each_new_event do |event|
26
+ result << event.resource_status_reason
27
+ end
28
+ end
29
+ end
30
+
22
31
  context "with a empty set of events" do
23
32
 
24
- describe "#new_events" do
33
+ describe "#each_new_event" do
25
34
 
26
- it "is empty" do
27
- expect(subject.new_events).to be_empty
35
+ it "yields nothing" do
36
+ expect(new_event_reasons).to be_empty
28
37
  end
29
38
 
30
39
  end
@@ -39,20 +48,16 @@ describe Stackup::StackWatcher do
39
48
  end
40
49
  end
41
50
 
42
- describe "#new_events" do
51
+ describe "#each_new_event" do
43
52
 
44
- it "is empty" do
45
- expect(subject.new_events).to be_empty
53
+ it "yields nothing" do
54
+ expect(new_event_reasons).to be_empty
46
55
  end
47
56
 
48
57
  end
49
58
 
50
59
  end
51
60
 
52
- def new_event_reasons
53
- subject.new_events.map(&:resource_status_reason)
54
- end
55
-
56
61
  context "when the stack has existing events" do
57
62
 
58
63
  before do
@@ -60,9 +65,9 @@ describe Stackup::StackWatcher do
60
65
  add_event("later")
61
66
  end
62
67
 
63
- describe "#new_events" do
68
+ describe "#each_new_event" do
64
69
 
65
- it "returns the events in the order they occurred" do
70
+ it "yields the events in the order they occurred" do
66
71
  expect(new_event_reasons).to eq(["earlier", "later"])
67
72
  end
68
73
 
@@ -71,14 +76,14 @@ describe Stackup::StackWatcher do
71
76
  context "and more events occur" do
72
77
 
73
78
  before do
74
- subject.new_events
79
+ new_event_reasons
75
80
  add_event("even")
76
81
  add_event("more")
77
82
  end
78
83
 
79
- describe "#new_events" do
84
+ describe "#each_new_event" do
80
85
 
81
- it "returns only the new events" do
86
+ it "yields only the new events" do
82
87
  expect(new_event_reasons).to eq(["even", "more"])
83
88
  end
84
89
 
data/stackup.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  Gem::Specification.new do |spec|
5
5
 
6
6
  spec.name = "stackup"
7
- spec.version = "0.1.0"
7
+ spec.version = "0.2.0"
8
8
  spec.authors = ["Arvind Kunday", "Mike Williams"]
9
9
  spec.email = ["arvind.kunday@rea-group.com", "mike.williams@rea-group.com"]
10
10
  spec.summary = "Manage CloudFormation stacks"
@@ -0,0 +1,44 @@
1
+ {
2
+ "AWSTemplateFormatVersion": "2010-09-09",
3
+ "Description": "AWS CloudFormation Sample Template S3_Website_Bucket_With_Retain_On_Delete: Sample template showing how to create a publicly accessible S3 bucket configured for website access with a deletion policy of retail on delete. **WARNING** This template creates an S3 bucket that will NOT be deleted when the stack is deleted. You will be billed for the AWS resources used if you create a stack from this template.",
4
+ "Resources": {
5
+ "S3Bucket": {
6
+ "Type": "AWS::S3::Bucket",
7
+ "Properties": {
8
+ "AccessControl": "PublicRead",
9
+ "WebsiteConfiguration": {
10
+ "IndexDocument": "index.html",
11
+ "ErrorDocument": "error.html"
12
+ }
13
+ }
14
+ }
15
+ },
16
+ "Outputs": {
17
+ "WebsiteURL": {
18
+ "Value": {
19
+ "Fn::GetAtt": [
20
+ "S3Bucket",
21
+ "WebsiteURL"
22
+ ]
23
+ },
24
+ "Description": "URL for website hosted on S3"
25
+ },
26
+ "S3BucketSecureURL": {
27
+ "Value": {
28
+ "Fn::Join": [
29
+ "",
30
+ [
31
+ "https://",
32
+ {
33
+ "Fn::GetAtt": [
34
+ "S3Bucket",
35
+ "DomainName"
36
+ ]
37
+ }
38
+ ]
39
+ ]
40
+ },
41
+ "Description": "Name of S3 bucket to hold website content"
42
+ }
43
+ }
44
+ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stackup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arvind Kunday
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-10-08 00:00:00.000000000 Z
12
+ date: 2015-10-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aws-sdk
@@ -81,18 +81,41 @@ files:
81
81
  - README.md
82
82
  - Rakefile
83
83
  - bin/stackup
84
+ - doc/Stackup.html
85
+ - doc/Stackup/ErrorMappingProxy.html
86
+ - doc/Stackup/InvalidStateError.html
87
+ - doc/Stackup/NoSuchStack.html
88
+ - doc/Stackup/NoUpdateRequired.html
89
+ - doc/Stackup/Service.html
90
+ - doc/Stackup/ServiceError.html
91
+ - doc/Stackup/Stack.html
92
+ - doc/Stackup/StackUpdateError.html
93
+ - doc/Stackup/StackWatcher.html
94
+ - doc/_index.html
95
+ - doc/class_list.html
96
+ - doc/css/common.css
97
+ - doc/css/full_list.css
98
+ - doc/css/style.css
99
+ - doc/file.README.html
100
+ - doc/file_list.html
101
+ - doc/frames.html
102
+ - doc/index.html
103
+ - doc/js/app.js
104
+ - doc/js/full_list.js
105
+ - doc/js/jquery.js
106
+ - doc/method_list.html
107
+ - doc/top-level-namespace.html
84
108
  - lib/stackup.rb
109
+ - lib/stackup/error_mapping_proxy.rb
85
110
  - lib/stackup/errors.rb
111
+ - lib/stackup/service.rb
86
112
  - lib/stackup/stack.rb
87
113
  - lib/stackup/stack_watcher.rb
88
- - pkg/stackup-0.0.1.gem
89
- - pkg/stackup-0.0.8.gem
90
- - pkg/stackup-0.0.9.gem
91
114
  - spec/spec_helper.rb
92
115
  - spec/stackup/stack_spec.rb
93
116
  - spec/stackup/stack_watcher_spec.rb
94
117
  - stackup.gemspec
95
- - woollyams/sample-template.json
118
+ - woollyams/template.json
96
119
  homepage: https://github.com/realestate-com-au/stackup
97
120
  licenses:
98
121
  - MIT
Binary file
Binary file
Binary file
@@ -1,79 +0,0 @@
1
- {
2
- "AWSTemplateFormatVersion": "2010-09-09",
3
- "Description": "A sample template",
4
- "Resources": {
5
- "role": {
6
- "Type": "AWS::IAM::Role",
7
- "Properties": {
8
- "AssumeRolePolicyDocument": {
9
- "Version" : "2012-10-17",
10
- "Statement": [
11
- {
12
- "Effect": "Allow",
13
- "Principal": {
14
- "Service": [ "ec2.amazonaws.com" ]
15
- },
16
- "Action": [ "sts:AssumeRole" ]
17
- }
18
- ]
19
- },
20
- "Path": "/",
21
- "Policies": [
22
- {
23
- "PolicyName": "rooty",
24
- "PolicyDocument": {
25
- "Version" : "2012-10-17",
26
- "Statement": [
27
- {
28
- "Effect": "Allow",
29
- "Action": "*",
30
- "Resource": "*"
31
- }
32
- ]
33
- }
34
- }
35
- ]
36
- }
37
- },
38
- "role2": {
39
- "Type": "AWS::IAM::Role",
40
- "Properties": {
41
- "AssumeRolePolicyDocument": {
42
- "Version" : "2012-10-17",
43
- "Statement": [
44
- {
45
- "Effect": "Allow",
46
- "Principal": {
47
- "Service": [ "ec2.amazonaws.com" ]
48
- },
49
- "Action": [ "sts:AssumeRole" ]
50
- }
51
- ]
52
- },
53
- "Path": "/blah/",
54
- "Policies": [
55
- {
56
- "PolicyName": "rooty",
57
- "PolicyDocument": {
58
- "Version" : "2012-10-17",
59
- "Statement": [
60
- {
61
- "Effect": "Allow",
62
- "Action": "*",
63
- "Resource": "*"
64
- }
65
- ]
66
- }
67
- }
68
- ]
69
- }
70
- }
71
- },
72
- "Outputs": {
73
- "role": {
74
- "Value": {
75
- "Ref": "role"
76
- }
77
- }
78
- }
79
- }