stackup 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +91 -16
- data/lib/stackup/source.rb +5 -7
- data/lib/stackup/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20ef7c568fc7e9522f584971713e2785e26628d7
|
4
|
+
data.tar.gz: ddc63cb469f6749a0880f9a048b2a35f110b6971
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
data/lib/stackup/source.rb
CHANGED
@@ -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
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
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
|
data/lib/stackup/version.rb
CHANGED
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.
|
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-
|
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
|