stackup 1.1.1 → 1.1.2

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: 4c9c28add918e16fcf983d251ccc71266f985fee
4
- data.tar.gz: 9d2254d1f66e6c89b112b1c9c8af9d70c0450aa7
3
+ metadata.gz: 20ef7c568fc7e9522f584971713e2785e26628d7
4
+ data.tar.gz: ddc63cb469f6749a0880f9a048b2a35f110b6971
5
5
  SHA512:
6
- metadata.gz: 277e194f8345b2cde8bbc8649309ef3c9487982e69a79b9ff290a4d0d1b595fa91866c446b302deac95ebf24e43d53d86cd35063d9b31746d7d9eca8a74207f2
7
- data.tar.gz: f0189757457cd35688b220f6ee22240a4224740321b856821d3d8df162f527afc289451e61d4a1f1a3816c3e5db9cbf94e8031024ec378fbf11643a9d07bb990
6
+ metadata.gz: 8d4f8835951cdbb655038217a10abb3fb1ae590341efd4bd9ee07e2cdb1108d00251752773fc951e32f6b99ae7b59e8c144e53a14b54452c42f815f716fbf5da
7
+ data.tar.gz: f745669e927ef53ffe51855a84b63ecd58b7428761db198b4a1508016ed81bcb2b2fe40e7358e2d364ed5fc8a99ba665581278ca6c7e7d646be9f9ed1d9d6284
data/README.md CHANGED
@@ -1,10 +1,29 @@
1
1
  # stackup
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/stackup.png)](http://badge.fury.io/rb/stackup)
3
4
  [![Build Status](https://travis-ci.org/realestate-com-au/stackup.svg?branch=master)](https://travis-ci.org/realestate-com-au/stackup)
4
5
 
5
6
  Stackup provides a CLI and a simplified Ruby API for dealing with
6
7
  AWS CloudFormation stacks.
7
8
 
9
+ <!-- TOC depthFrom:2 depthTo:6 withLinks:1 updateOnSave:1 orderedList:0 -->
10
+
11
+ - [Why?](#why)
12
+ - [Installation](#installation)
13
+ - [Command-line usage](#command-line-usage)
14
+ - [Stack create/update](#stack-createupdate)
15
+ - [Specifying parameters](#specifying-parameters)
16
+ - [YAML support](#yaml-support)
17
+ - [AWS credentials](#aws-credentials)
18
+ - [Using URLs as inputs](#using-urls-as-inputs)
19
+ - [Stack deletion](#stack-deletion)
20
+ - [Stack inspection](#stack-inspection)
21
+ - [Programmatic usage](#programmatic-usage)
22
+ - [Rake integration](#rake-integration)
23
+ - [Docker image](#docker-image)
24
+
25
+ <!-- /TOC -->
26
+
8
27
  ## Why?
9
28
 
10
29
  Stackup provides some advantages over using `awscli` or `aws-sdk` directly:
@@ -48,6 +67,77 @@ This will:
48
67
  * update (or create) the named CloudFormation stack, using the specified template
49
68
  * monitor events until the stack update is complete
50
69
 
70
+ For more details on usage, see
71
+
72
+ $ stackup STACK up --help
73
+
74
+ ### Specifying parameters
75
+
76
+ Stack parameters can be be read from a file, e.g.
77
+
78
+ $ stackup myapp-test up -t template.json -p parameters.json
79
+
80
+ Parameters can be specified as simple key-value pairs:
81
+
82
+ ```json
83
+ {
84
+ "IndexDoc": "index.html"
85
+ }
86
+ ```
87
+
88
+ but also supports the [extended JSON format used by the AWS CLI](http://docs.aws.amazon.com/cli/latest/reference/cloudformation/create-stack.html):
89
+
90
+
91
+ ```json
92
+ [
93
+ {
94
+ "ParameterKey": "IndexDoc",
95
+ "ParameterValue": "index.html",
96
+ "UsePreviousValue": false
97
+ }
98
+ ]
99
+ ```
100
+
101
+ You may specify `-p` multiple times; `stackup` will read and merge all the files:
102
+
103
+ $ stackup myapp-test up -t template.json \
104
+ -p defaults.json \
105
+ -p overrides.json
106
+
107
+ Or, you can specify parameters on the command-line, via `-o`:
108
+
109
+ $ stackup myapp-test up -t template.json \
110
+ -o IndexDoc=index.html
111
+
112
+ ### YAML support
113
+
114
+ `stackup` supports input files (template, parameters, tags) in YAML format, as well as JSON.
115
+
116
+ It also supports the [abbreviated YAML syntax for Cloudformation functions](https://aws.amazon.com/blogs/aws/aws-cloudformation-update-yaml-cross-stack-references-simplified-substitution/), though unlike the [AWS CLI](https://aws.amazon.com/cli/), Stackup normalises YAML input to JSON before invoking CloudFormation APIs.
117
+
118
+ ### AWS credentials
119
+
120
+ The stackup command-line looks for AWS credentials in the [standard environment variables](https://blogs.aws.amazon.com/security/post/Tx3D6U6WSFGOK2H/A-New-and-Standardized-Way-to-Manage-Credentials-in-the-AWS-SDKs).
121
+
122
+ You can also use the `--with-role` option to temporarily assume a different IAM role, for stack operations:
123
+
124
+ $ stackup myapp-test up -t template.json \
125
+ --with-role arn:aws:iam::862905684840:role/deployment
126
+
127
+ ### Using URLs as inputs
128
+
129
+ You can use either local files, or HTTP URLs, to specify inputs; stack template, parameters, etc.
130
+
131
+ $ stackup mystack up \
132
+ -t https://s3.amazonaws.com/mybucket/stack-template.json
133
+
134
+ Where a template URL references an object in S3, `stackup` leverages [CloudFormation's native support](http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CreateStack.html) for such URLs, enabling use of much larger templates.
135
+
136
+ Non-S3 URLs are also supported, though in that case `stackup` must fetch the content itself:
137
+
138
+ $ stackup mystack up \
139
+ -t https://raw.githubusercontent.com/realestate-com-au/stackup/master/examples/template.yml
140
+
51
141
  ### Stack deletion
52
142
 
53
143
  Sub-command "delete" deletes the stack.
@@ -100,12 +190,6 @@ Parameters and tags may be specified via files, or as a Hash, e.g.
100
190
  t.tags = { "environment" => "production" }
101
191
  end
102
192
 
103
- ## YAML support
104
-
105
- Stackup supports input files (template, parameters, tags) in either JSON or YAML format.
106
-
107
- It also supports the [abbreviated YAML syntax for Cloudformation functions](https://aws.amazon.com/blogs/aws/aws-cloudformation-update-yaml-cross-stack-references-simplified-substitution/), though unlike the [AWS CLI](https://aws.amazon.com/cli/), Stackup normalises YAML input to JSON before invoking CloudFormation APIs.
108
-
109
193
  ## Docker image
110
194
 
111
195
  Stackup is also published as a Docker image. Basic usage is:
@@ -116,16 +200,7 @@ Stackup is also published as a Docker image. Basic usage is:
116
200
  -e AWS_DEFAULT_REGION \
117
201
  realestate/stackup:latest ...
118
202
 
119
- Replace "latest" with a specific version for added safety.
203
+ If you're sensible, you'll replace "latest", with a specific [version](https://rubygems.org/gems/stackup/versions).
120
204
 
121
205
  The default working-directory within the container is `/cwd`;
122
206
  hence the volume mount to make files available from the host system.
123
-
124
- ## AWS credentials
125
-
126
- The stackup command-line looks for AWS credentials in the [standard environment variables](https://blogs.aws.amazon.com/security/post/Tx3D6U6WSFGOK2H/A-New-and-Standardized-Way-to-Manage-Credentials-in-the-AWS-SDKs).
127
-
128
- You can also use the `--with-role` option to temporarily assume a different IAM role, for stack operations:
129
-
130
- $ stackup myapp-test up -t template.json \
131
- --with-role arn:aws:iam::862905684840:role/deployment
@@ -29,8 +29,6 @@ module Stackup
29
29
 
30
30
  private
31
31
 
32
- LOOKS_LIKE_JSON = /^\s*[\{\[]/
33
-
34
32
  def uri
35
33
  URI(location)
36
34
  end
@@ -52,11 +50,11 @@ module Stackup
52
50
  end
53
51
 
54
52
  def parse_body
55
- if body =~ LOOKS_LIKE_JSON
56
- MultiJson.load(body)
57
- else
58
- Stackup::YAML.load(body)
59
- end
53
+ begin
54
+ MultiJson.load(body)
55
+ rescue MultiJson::ParseError
56
+ Stackup::YAML.load(body)
57
+ end
60
58
  end
61
59
 
62
60
  class ReadError < StandardError
@@ -1,5 +1,5 @@
1
1
  module Stackup
2
2
 
3
- VERSION = "1.1.1"
3
+ VERSION = "1.1.2"
4
4
 
5
5
  end
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: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Williams
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-02-23 00:00:00.000000000 Z
12
+ date: 2017-04-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aws-sdk-resources