rubycfn 0.3.5 → 0.3.6
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 +4 -4
- data/CHANGELOG.md +5 -1
- data/Gemfile.lock +1 -1
- data/README.md +28 -1
- data/bin/rubycfn +25 -0
- data/lib/rubycfn/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4442707e07573f3c2da20d53671910caf3f8c8d
|
4
|
+
data.tar.gz: 10183704a3a12f0d77b8dabe8f1b5c3570454e01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5941864e3125790d0a59da7fa26862e5e2929e020f0342ff670378502075f2208086f858333ec060fd1d620974a3f7a7333c2559f828c966ac17bf82d5ea3c12
|
7
|
+
data.tar.gz: 8dc9c51d380d69b36c2b65bff6528c2b9fa1768d3382777894344d5d8e8b140698ba5ad29a4a5c478eabf91ac3fad47712b105c2dd381ee2f41d9022812cffdd
|
data/CHANGELOG.md
CHANGED
@@ -2,7 +2,11 @@
|
|
2
2
|
All notable changes to Rubycfn will be documented in this file.
|
3
3
|
This project uses [Semantic Versioning](http://semver.org/).
|
4
4
|
|
5
|
-
## 0.3.
|
5
|
+
## 0.3.7 (Next Release)
|
6
|
+
|
7
|
+
## 0.3.6
|
8
|
+
|
9
|
+
* Added STDIN pipe to rubycfn cli and file name argument support -- [@dennisvink][@dennisvink]
|
6
10
|
|
7
11
|
## 0.3.5
|
8
12
|
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -3,6 +3,8 @@
|
|
3
3
|
[RubyCfn](https://rubycfn.com/) is a light-weight tiny CloudFormation, Deployment Manager and ARM DSL to make expressing
|
4
4
|
AWS templates as Ruby code a bit more pleasing to the eye.
|
5
5
|
|
6
|
+
You can find the [CloudFormation Compiler](https://rubycfn.com/) at https://rubycfn.com with examples.
|
7
|
+
|
6
8
|
Note, as of 0.3.3 the default project structure changed quite a bit. The README.md does not reflect
|
7
9
|
those changes yet. A rubycfn project is now provisioned with a nested stack set up, and includes
|
8
10
|
a nested VPC and a nested ECS stack.
|
@@ -20,7 +22,7 @@ __________ ____ __________________.___._________ _____________________
|
|
20
22
|
| _/ | /| | _// | |/ \ \/ | __) | | _/
|
21
23
|
| | \ | / | | \\____ |\ \____| \ | | \
|
22
24
|
|____|_ /______/ |______ // ______| \______ /\___ / |______ /
|
23
|
-
\/ \/ \/ \/ \/ \/ [v0.3.
|
25
|
+
\/ \/ \/ \/ \/ \/ [v0.3.6]
|
24
26
|
Project name? example
|
25
27
|
Account ID? 1234567890
|
26
28
|
Select region EU (Frankfurt)
|
@@ -228,6 +230,31 @@ For example:
|
|
228
230
|
end
|
229
231
|
```
|
230
232
|
|
233
|
+
## Generating CloudFormation using the Rubycfn CLI
|
234
|
+
|
235
|
+
It is not necessary to start a Rubycfn project to generate CloudFormation templates.
|
236
|
+
The examples from the [Rubycfn CloudFormation Compiler](https://rubycfn.com/) can be used with the Rubycfn cli directly.
|
237
|
+
Take this `template.rb` as an example:
|
238
|
+
|
239
|
+
```ruby
|
240
|
+
parameter :bucket_name,
|
241
|
+
description: "Bucket name"
|
242
|
+
|
243
|
+
resource :foobar,
|
244
|
+
type: "AWS::S3::Bucket" do |r|
|
245
|
+
r.property(:name) { :bucket_name.ref }
|
246
|
+
end
|
247
|
+
```
|
248
|
+
|
249
|
+
You can generate a CloudFormation template from this script in the following ways:
|
250
|
+
`cat template.rb | rubycfn`
|
251
|
+
|
252
|
+
or
|
253
|
+
|
254
|
+
`rubycfn template.rb`
|
255
|
+
|
256
|
+
Both commands will output the CloudFormation template without the need for you to set up a project.
|
257
|
+
|
231
258
|
## Implemented AWS functions
|
232
259
|
|
233
260
|
You can Ref by postpending the .ref method to any string. E.g. "string".ref
|
data/bin/rubycfn
CHANGED
@@ -8,6 +8,31 @@ require "rubycfn/version"
|
|
8
8
|
|
9
9
|
require_relative "../lib/cli_methods"
|
10
10
|
|
11
|
+
if ARGV.first || (ARGF.filename != "-" or (not STDIN.tty? and not STDIN.closed?))
|
12
|
+
require "rubycfn"
|
13
|
+
require "active_support/concern"
|
14
|
+
module RubycfnStack
|
15
|
+
if (ARGF.filename != "-" or (not STDIN.tty? and not STDIN.closed?))
|
16
|
+
contents = []
|
17
|
+
ARGF.each_line do |line|
|
18
|
+
contents.push(line)
|
19
|
+
end
|
20
|
+
contents = contents.join("\n")
|
21
|
+
else
|
22
|
+
raise "File #{ARGV.first} not found!" unless File.file?(ARGV.first)
|
23
|
+
contents = File.read(ARGV.first)
|
24
|
+
end
|
25
|
+
extend ActiveSupport::Concern
|
26
|
+
include Rubycfn
|
27
|
+
included do
|
28
|
+
eval(contents)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
cfn = include RubycfnStack
|
32
|
+
puts cfn.render_template
|
33
|
+
exit
|
34
|
+
end
|
35
|
+
|
11
36
|
path = File.expand_path(File.dirname(File.dirname(__FILE__)))
|
12
37
|
puts rubycfn_banner(Rubycfn::VERSION)
|
13
38
|
prompt = TTY::Prompt.new
|
data/lib/rubycfn/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubycfn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dennis Vink
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-07-
|
11
|
+
date: 2019-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: neatjson
|
@@ -324,7 +324,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
324
324
|
version: '0'
|
325
325
|
requirements: []
|
326
326
|
rubyforge_project:
|
327
|
-
rubygems_version: 2.
|
327
|
+
rubygems_version: 2.6.7
|
328
328
|
signing_key:
|
329
329
|
specification_version: 4
|
330
330
|
summary: Rubycfn
|