lono 2.0.4 → 2.0.5

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: 8ab0ce183e26fd93e33dac3fc810ecdd793bd1f3
4
- data.tar.gz: ec9433a8e3fbe00c86463f76305695790e7c3d84
3
+ metadata.gz: 4004cb33d3863a0160d5e75e3e24fd261448e206
4
+ data.tar.gz: b83737a5e2de0c98835fcebbc44da709b4e0e2b1
5
5
  SHA512:
6
- metadata.gz: 5b4b9697089c8449295e72dad1e953072c0ea2edf3aff8bd54f7c5898e3bb1121a67d0ff99d52d55bf6e5f423f0a6db7d7e225f077fab4879451d1a2f35fe5a1
7
- data.tar.gz: 362c8b9f3f4cac0537c48a19cab94b4867b9613245230532a4a2296786a6185b79e4ff12345ba5f3e03ac54a513294a0c4a5ce037287900ded29ad133bf03390
6
+ metadata.gz: 781e08333e3487dfc7025406f2b83b994bbadc22783bbb723e31f479ae4e9686accef93dfc870c6c014d6c8bb5245d24ff0ea55dfe6b4c33fd52cf01f65a693e
7
+ data.tar.gz: 9fbbd4cd14c0b7ae2b7a644950acb954fe54774c07f5c3d89a8a2cb302d2a02b43077e41e5ced05c5dc6c5cc08e7cd86cc2542763532251aebc82d8a05c2fabb
@@ -1,3 +1,3 @@
1
1
  [submodule "vendor/plissken"]
2
2
  path = vendor/plissken
3
- url = git@github.com:tongueroo/plissken.git
3
+ url = https://github.com/tongueroo/plissken.git
@@ -3,6 +3,10 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  This project *tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
5
5
 
6
+ ## [2.0.5]
7
+ - add example template to starter app
8
+ - add docs website
9
+
6
10
  ## [2.0.4]
7
11
  - cfn preview: exit gracefully when stack doesnt exist
8
12
  - exit gracefully with ctrl-c
@@ -0,0 +1,56 @@
1
+ # Contributing to Lono
2
+
3
+ Contributing is welcomed and encouraged. We love pull requests!
4
+
5
+ Here are some ways *you* can contribute:
6
+
7
+ * by reporting bugs
8
+ * by suggesting new features
9
+ * by writing or editing documentation
10
+ * by writing specs
11
+ * by writing code ( **no patch is too small** : fix typos, add comments, clean up inconsistent whitespace )
12
+ * by refactoring code
13
+ * by closing [issues][]
14
+ * by reviewing patches
15
+
16
+ [issues]: https://github.com/tongueroo/lono/issues
17
+
18
+ ## Submitting an Issue
19
+
20
+ * We use the [GitHub issue tracker][issues] to track bugs and features.
21
+ * Before submitting a bug report or feature request, check to make sure it hasn't
22
+ already been submitted.
23
+ * When submitting a bug report, please include a [Gist][] that includes a stack
24
+ trace and any details that may be necessary to reproduce the bug, including
25
+ your gem version, Ruby version, and operating system. Ideally, a bug report
26
+ should include a pull request with failing specs.
27
+
28
+ [gist]: https://gist.github.com/
29
+
30
+ ## Cleaning up issues
31
+
32
+ * Issues that have no response from the submitter will be closed after 30 days.
33
+ * Issues will be closed once they're assumed to be fixed or answered. If the
34
+ maintainer is wrong, it can be opened again.
35
+ * If your issue is closed by mistake, please understand and explain the issue.
36
+ We will happily reopen the issue.
37
+
38
+ ## Submitting a Pull Request
39
+ 1. [Fork][fork] the [official repository][repo].
40
+ 2. [Create a topic branch.][branch]
41
+ 3. Implement your feature or bug fix.
42
+ 4. Add, commit, and push your changes.
43
+ 5. [Submit a pull request.][pr]
44
+
45
+ ## Notes
46
+ * Please add tests if you changed code. Contributions without tests won't be accepted.
47
+ * If you don't know how to add tests, please put in a PR and leave a comment
48
+ asking for help. We love helping!
49
+ * Please don't update the Gem version.
50
+
51
+ [repo]: https://github.com/tongueroo/lono/tree/master
52
+ [fork]: https://help.github.com/articles/fork-a-repo/
53
+ [branch]: https://help.github.com/articles/creating-and-deleting-branches-within-your-repository/
54
+ [pr]: https://help.github.com/articles/using-pull-requests/
55
+
56
+ Inspired by https://github.com/middleman/middleman-heroku/blob/master/CONTRIBUTING.md
@@ -19,4 +19,5 @@ module Lono
19
19
  autoload :Template, 'lono/template'
20
20
  autoload :Cfn, 'lono/cfn'
21
21
  autoload :Param, 'lono/param'
22
+ autoload :Clean, 'lono/clean'
22
23
  end
@@ -1,64 +1,62 @@
1
1
  require "thor"
2
2
 
3
- module Lono
4
- class Cfn < Command
5
- autoload :Help, 'lono/cfn/help'
6
- autoload :AwsServices, 'lono/cfn/aws_services'
7
- autoload :Util, 'lono/cfn/util'
8
- autoload :CLI, 'lono/cfn/cli'
9
- autoload :Base, 'lono/cfn/base'
10
- autoload :Create, 'lono/cfn/create'
11
- autoload :Update, 'lono/cfn/update'
12
- autoload :Delete, 'lono/cfn/delete'
13
- autoload :Preview, 'lono/cfn/preview'
14
- autoload :Diff, 'lono/cfn/diff'
15
-
16
- class_option :verbose, type: :boolean
17
- class_option :noop, type: :boolean
18
- class_option :project_root, desc: "Project folder. Defaults to current directory", default: "."
19
- class_option :region, desc: "AWS region"
20
-
21
- # common to create and update
22
- class_option :template, desc: "override convention and specify the template file to use"
23
- class_option :param, desc: "override convention and specify the param file to use"
24
- class_option :lono, type: :boolean, desc: "invoke lono to generate CloudFormation templates", default: true
25
-
26
- desc "create STACK", "create a CloudFormation stack"
27
- long_desc Help.create
28
- def create(name)
29
- Create.new(name, options).run
30
- end
3
+ class Lono::Cfn < Lono::Command
4
+ autoload :Help, 'lono/cfn/help'
5
+ autoload :AwsServices, 'lono/cfn/aws_services'
6
+ autoload :Util, 'lono/cfn/util'
7
+ autoload :CLI, 'lono/cfn/cli'
8
+ autoload :Base, 'lono/cfn/base'
9
+ autoload :Create, 'lono/cfn/create'
10
+ autoload :Update, 'lono/cfn/update'
11
+ autoload :Delete, 'lono/cfn/delete'
12
+ autoload :Preview, 'lono/cfn/preview'
13
+ autoload :Diff, 'lono/cfn/diff'
14
+
15
+ class_option :verbose, type: :boolean
16
+ class_option :noop, type: :boolean
17
+ class_option :project_root, desc: "Project folder. Defaults to current directory", default: "."
18
+ class_option :region, desc: "AWS region"
19
+
20
+ # common to create and update
21
+ class_option :template, desc: "override convention and specify the template file to use"
22
+ class_option :param, desc: "override convention and specify the param file to use"
23
+ class_option :lono, type: :boolean, desc: "invoke lono to generate CloudFormation templates", default: true
24
+
25
+ desc "create STACK", "create a CloudFormation stack"
26
+ long_desc Help.create
27
+ def create(name)
28
+ Create.new(name, options).run
29
+ end
31
30
 
32
- desc "update STACK", "update a CloudFormation stack"
33
- long_desc Help.update
34
- option :change_set, type: :boolean, default: true, desc: "Uses generated change set to update the stack. If false, will perform normal update-stack."
35
- option :diff, type: :boolean, default: true, desc: "Show diff of the source code template changes before continuing."
36
- option :preview, type: :boolean, default: true, desc: "Show preview of the stack changes before continuing."
37
- option :sure, type: :boolean, desc: "Skips are you sure prompt"
38
- def update(name)
39
- Update.new(name, options).run
40
- end
31
+ desc "update STACK", "update a CloudFormation stack"
32
+ long_desc Help.update
33
+ option :change_set, type: :boolean, default: true, desc: "Uses generated change set to update the stack. If false, will perform normal update-stack."
34
+ option :diff, type: :boolean, default: true, desc: "Show diff of the source code template changes before continuing."
35
+ option :preview, type: :boolean, default: true, desc: "Show preview of the stack changes before continuing."
36
+ option :sure, type: :boolean, desc: "Skips are you sure prompt"
37
+ def update(name)
38
+ Update.new(name, options).run
39
+ end
41
40
 
42
- desc "delete STACK", "delete a CloudFormation stack"
43
- long_desc Help.delete
44
- option :sure, type: :boolean, desc: "Skips are you sure prompt"
45
- def delete(name)
46
- Delete.new(name, options).run
47
- end
41
+ desc "delete STACK", "delete a CloudFormation stack"
42
+ long_desc Help.delete
43
+ option :sure, type: :boolean, desc: "Skips are you sure prompt"
44
+ def delete(name)
45
+ Delete.new(name, options).run
46
+ end
48
47
 
49
- desc "preview STACK", "preview a CloudFormation stack update"
50
- long_desc Help.preview
51
- option :keep, type: :boolean, desc: "keep the changeset instead of deleting it afterwards"
52
- option :diff, type: :boolean, default: true, desc: "Show diff of the source code template changes also."
53
- def preview(name)
54
- Diff.new(name, options).run if options[:diff]
55
- Preview.new(name, options).run
56
- end
48
+ desc "preview STACK", "preview a CloudFormation stack update"
49
+ long_desc Help.preview
50
+ option :keep, type: :boolean, desc: "keep the changeset instead of deleting it afterwards"
51
+ option :diff, type: :boolean, default: true, desc: "Show diff of the source code template changes also."
52
+ def preview(name)
53
+ Diff.new(name, options).run if options[:diff]
54
+ Preview.new(name, options).run
55
+ end
57
56
 
58
- desc "diff STACK", "diff of newly generated template vs existing template in AWS"
59
- long_desc Help.diff
60
- def diff(name)
61
- Diff.new(name, options).run
62
- end
57
+ desc "diff STACK", "diff of newly generated template vs existing template in AWS"
58
+ long_desc Help.diff
59
+ def diff(name)
60
+ Diff.new(name, options).run
63
61
  end
64
62
  end
@@ -1,4 +1,5 @@
1
1
  require "lono"
2
+ require "byebug"
2
3
 
3
4
  class Lono::Cfn::Base
4
5
  include Lono::Cfn::AwsServices
@@ -100,10 +101,11 @@ class Lono::Cfn::Base
100
101
 
101
102
  # Returns String with value of "yml" or "json".
102
103
  def detect_format
103
- formats = Dir.glob("#{@project_root}/output/**/*").map { |path| path }.
104
- reject { |s| s =~ %r{/params/} }. # reject output/params folder
104
+ formats = Dir.glob("#{@project_root}/templates/**/*").
105
+ map { |path| path.sub(/\.erb$/, '') }.
105
106
  map { |path| File.extname(path) }.
106
107
  reject { |s| s.empty? }. # reject ""
108
+ select { |s| s.include?("yml") || s.include?("json") }.
107
109
  uniq
108
110
  if formats.size > 1
109
111
  puts "ERROR: Detected multiple formats: #{formats.join(", ")}".colorize(:red)
@@ -112,7 +114,7 @@ class Lono::Cfn::Base
112
114
  elsif formats.size == 1
113
115
  formats.first.sub(/^\./,'')
114
116
  else
115
- puts "WARN: Did not detect any template formats. Defaulting to yml. Please check the config and templates folders."
117
+ puts "WARN: Did not detect any template formats. Defaulting to yml. Please check the config and templates folders.".colorize(:yellow)
116
118
  "yml" # default format
117
119
  end
118
120
  end
@@ -0,0 +1,15 @@
1
+ require "fileutils"
2
+
3
+ class Lono::Clean
4
+ attr_reader :options
5
+ def initialize(options)
6
+ @options = options
7
+ @project_root = options[:project_root] || '.'
8
+ end
9
+
10
+ def run
11
+ puts "Cleaning up"
12
+ puts "Removing output/*"
13
+ FileUtils.rm_rf("#{@project_root}/output/*")
14
+ end
15
+ end
@@ -3,8 +3,7 @@ require 'lono/command'
3
3
 
4
4
  module Lono
5
5
  autoload :Help, 'lono/help'
6
-
7
- class CLI < Command
6
+ class CLI < Lono::Command
8
7
 
9
8
  desc "new [NAME]", "Generates lono starter project"
10
9
  Help.new_long_desc
@@ -27,6 +26,11 @@ module Lono
27
26
  Lono::Param::Generator.generate_all(options.clone)
28
27
  end
29
28
 
29
+ desc "clean", "Clean up generated files"
30
+ def clean
31
+ Lono::Clean.new(options.clone).run
32
+ end
33
+
30
34
  desc "version", "Prints version"
31
35
  def version
32
36
  puts Lono::VERSION
@@ -1,25 +1,23 @@
1
1
  require 'thor'
2
2
 
3
- module Lono
4
- class Command < Thor
5
- class << self
6
- def dispatch(m, args, options, config)
7
- # Allow calling for help via:
8
- # lono generate help
9
- # lono generate -h
10
- # lono generate --help
11
- # lono generate -D
12
- #
13
- # as well thor's nomral setting as
14
- #
15
- # lono help generate
16
- help_flags = Thor::HELP_MAPPINGS + ["help"]
17
- if args.length > 1 && !(args & help_flags).empty?
18
- args -= help_flags
19
- args.insert(-2, "help")
20
- end
21
- super
3
+ class Lono::Command < Thor
4
+ class << self
5
+ def dispatch(m, args, options, config)
6
+ # Allow calling for help via:
7
+ # lono generate help
8
+ # lono generate -h
9
+ # lono generate --help
10
+ # lono generate -D
11
+ #
12
+ # as well thor's nomral setting as
13
+ #
14
+ # lono help generate
15
+ help_flags = Thor::HELP_MAPPINGS + ["help"]
16
+ if args.length > 1 && !(args & help_flags).empty?
17
+ args -= help_flags
18
+ args.insert(-2, "help")
22
19
  end
20
+ super
23
21
  end
24
22
  end
25
23
  end
@@ -1,33 +1,31 @@
1
- module Lono
2
- class New
3
- attr_reader :options
4
- def initialize(options)
5
- @options = options
6
- @project_root = options[:project_root] || '.'
7
- @format = options[:format] || 'json'
8
- end
1
+ class Lono::New
2
+ attr_reader :options
3
+ def initialize(options)
4
+ @options = options
5
+ @project_root = options[:project_root] || '.'
6
+ @format = options[:format] || 'json'
7
+ end
9
8
 
10
- def run
11
- puts "Setting up lono project" unless options[:quiet]
12
- source_root = File.expand_path("../../starter_projects/#{@format}_project", __FILE__)
13
- paths = Dir.glob("#{source_root}/**/*").
14
- select {|p| File.file?(p) }
15
- paths.each do |src|
16
- # starter_projects/yaml_project/ ->
17
- regexp = Regexp.new(".*starter_projects/#{@format}_project/")
18
- dest = src.gsub(regexp,'')
19
- dest = "#{@project_root}/#{dest}"
9
+ def run
10
+ puts "Setting up lono project" unless options[:quiet]
11
+ source_root = File.expand_path("../../starter_projects/#{@format}_project", __FILE__)
12
+ paths = Dir.glob("#{source_root}/**/*").
13
+ select {|p| File.file?(p) }
14
+ paths.each do |src|
15
+ # starter_projects/yaml_project/ ->
16
+ regexp = Regexp.new(".*starter_projects/#{@format}_project/")
17
+ dest = src.gsub(regexp,'')
18
+ dest = "#{@project_root}/#{dest}"
20
19
 
21
- if File.exist?(dest) and !options[:force]
22
- puts "already exists: #{dest}" unless options[:quiet]
23
- else
24
- puts "creating: #{dest}" unless options[:quiet]
25
- dirname = File.dirname(dest)
26
- FileUtils.mkdir_p(dirname) unless File.exist?(dirname)
27
- FileUtils.cp(src, dest)
28
- end
20
+ if File.exist?(dest) and !options[:force]
21
+ puts "already exists: #{dest}" unless options[:quiet]
22
+ else
23
+ puts "creating: #{dest}" unless options[:quiet]
24
+ dirname = File.dirname(dest)
25
+ FileUtils.mkdir_p(dirname) unless File.exist?(dirname)
26
+ FileUtils.cp(src, dest)
29
27
  end
30
- puts "Starter lono project created" unless options[:quiet]
31
28
  end
29
+ puts "Starter lono project created" unless options[:quiet]
32
30
  end
33
31
  end
@@ -1,20 +1,18 @@
1
1
  require "thor"
2
2
 
3
- module Lono
4
- class Param < Command
5
- autoload :Help, 'lono/param/help'
6
- autoload :Generator, 'lono/param/generator'
3
+ class Lono::Param < Lono::Command
4
+ autoload :Help, 'lono/param/help'
5
+ autoload :Generator, 'lono/param/generator'
7
6
 
8
- class_option :verbose, type: :boolean
9
- class_option :noop, type: :boolean
10
- class_option :mute, type: :boolean
11
- class_option :project_root, desc: "project root to use", default: '.'
7
+ class_option :verbose, type: :boolean
8
+ class_option :noop, type: :boolean
9
+ class_option :mute, type: :boolean
10
+ class_option :project_root, desc: "project root to use", default: '.'
12
11
 
13
- desc "generate NAME", "generate parameter json file for NAME"
14
- long_desc Help.generate
15
- option :path, desc: "Name of the source that maps to the params txt file. name -> params/NAME.txt. Use this to override the params/NAME.txt convention"
16
- def generate
17
- Generator.generate_all(options)
18
- end
12
+ desc "generate NAME", "generate parameter json file for NAME"
13
+ long_desc Help.generate
14
+ option :path, desc: "Name of the source that maps to the params txt file. name -> params/NAME.txt. Use this to override the params/NAME.txt convention"
15
+ def generate
16
+ Generator.generate_all(options)
19
17
  end
20
18
  end
@@ -1,44 +1,42 @@
1
- module Lono
2
- class ProjectChecker
1
+ class Lono::ProjectChecker
3
2
  # Checks to see command is running in a lono project.
4
- # If not, provide a friendly message and exit.
5
- def self.check(project_root)
6
- new(project_root).check
7
- end
3
+ # If not, provide a friendly message and exit.
4
+ def self.check(project_root)
5
+ new(project_root).check
6
+ end
8
7
 
9
- def initialize(project_root)
10
- @project_root = project_root
11
- end
8
+ def initialize(project_root)
9
+ @project_root = project_root
10
+ end
12
11
 
13
- def check
14
- config_folder_exist
15
- templates_folder_exist
16
- empty_folders
17
- end
12
+ def check
13
+ config_folder_exist
14
+ templates_folder_exist
15
+ empty_folders
16
+ end
18
17
 
19
- def config_folder_exist
20
- unless File.exist?("#{@project_root}/config")
21
- puts "The config folder does not exist in this project. Are you sure this is a lono project?"
22
- exit 1
23
- end
18
+ def config_folder_exist
19
+ unless File.exist?("#{@project_root}/config")
20
+ puts "The config folder does not exist in this project. Are you sure this is a lono project?"
21
+ exit 1
24
22
  end
23
+ end
25
24
 
26
- def templates_folder_exist
27
- unless File.exist?("#{@project_root}/templates")
28
- puts "The templates folder does not exist in this project. Are you sure this is a lono project?"
29
- exit 1
30
- end
25
+ def templates_folder_exist
26
+ unless File.exist?("#{@project_root}/templates")
27
+ puts "The templates folder does not exist in this project. Are you sure this is a lono project?"
28
+ exit 1
31
29
  end
30
+ end
32
31
 
33
- def empty_folders
34
- if Dir["#{@project_root}/config/**/*.rb"].empty?
35
- puts "The config folder does not contain any lono template definitions."
36
- exit 1
37
- end
38
- if Dir["#{@project_root}/templates/**/*"].empty?
39
- puts "The templates folder does not contain any lono template definitions."
40
- exit 1
41
- end
32
+ def empty_folders
33
+ if Dir["#{@project_root}/config/**/*.rb"].empty?
34
+ puts "The config folder does not contain any lono template definitions."
35
+ exit 1
36
+ end
37
+ if Dir["#{@project_root}/templates/**/*"].empty?
38
+ puts "The templates folder does not contain any lono template definitions."
39
+ exit 1
42
40
  end
43
41
  end
44
42
  end
@@ -1,27 +1,25 @@
1
1
  require "thor"
2
2
  require_relative "command"
3
3
 
4
- module Lono
5
- class Template < Command
6
- autoload :Help, 'lono/template/help'
7
- autoload :Bashify, 'lono/template/bashify'
8
- autoload :DSL, 'lono/template/dsl'
9
- autoload :Template, 'lono/template/template'
4
+ class Lono::Template < Lono::Command
5
+ autoload :Help, 'lono/template/help'
6
+ autoload :Bashify, 'lono/template/bashify'
7
+ autoload :DSL, 'lono/template/dsl'
8
+ autoload :Template, 'lono/template/template'
10
9
 
11
- desc "generate", "Generate the CloudFormation templates"
12
- Help.generate
13
- option :clean, type: :boolean, aliases: "-c", desc: "remove all output files before generating"
14
- option :project_root, default: ".", aliases: "-r", desc: "project root"
15
- option :quiet, type: :boolean, aliases: "-q", desc: "silence the output"
16
- option :pretty, type: :boolean, default: true, desc: "json pretty the output. only applies with json format"
17
- def generate
18
- DSL.new(options.clone).run
19
- end
10
+ desc "generate", "Generate the CloudFormation templates"
11
+ Help.generate
12
+ option :clean, type: :boolean, aliases: "-c", desc: "remove all output files before generating"
13
+ option :project_root, default: ".", aliases: "-r", desc: "project root"
14
+ option :quiet, type: :boolean, aliases: "-q", desc: "silence the output"
15
+ option :pretty, type: :boolean, default: true, desc: "json pretty the output. only applies with json format"
16
+ def generate
17
+ DSL.new(options.clone).run
18
+ end
20
19
 
21
- desc "bashify [URL-OR-PATH]", "Convert the UserData section of an existing CloudFormation Template to a starter bash script that is compatiable with lono"
22
- Help.bashify
23
- def bashify(path)
24
- Bashify.new(path: path).run
25
- end
20
+ desc "bashify [URL-OR-PATH]", "Convert the UserData section of an existing CloudFormation Template to a starter bash script that is compatiable with lono"
21
+ Help.bashify
22
+ def bashify(path)
23
+ Bashify.new(path: path).run
26
24
  end
27
25
  end
@@ -1,3 +1,3 @@
1
1
  module Lono
2
- VERSION = "2.0.4"
2
+ VERSION = "2.0.5"
3
3
  end
@@ -1,3 +1,7 @@
1
+ template "example.yml" do
2
+ source "example.yml.erb"
3
+ end
4
+
1
5
  template "blog-web-prod.yml" do
2
6
  app,role,env = name.sub('.yml','').split('-')
3
7
  source "web.yml.erb"
@@ -0,0 +1,2 @@
1
+ InstanceType=t2.micro
2
+ KeyName=tutorial
@@ -0,0 +1,430 @@
1
+ # http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/sample-templates-services-us-west-2.html#w1ab2c21c45c15c15
2
+ # Amazon EC2 instance in a security group Creates an Amazon EC2 instance in an Amazon EC2 security group.
3
+ ---
4
+ AWSTemplateFormatVersion: '2010-09-09'
5
+ Description: 'AWS CloudFormation Sample Template EC2InstanceWithSecurityGroupSample:
6
+ Create an Amazon EC2 instance running the Amazon Linux AMI. The AMI is chosen based
7
+ on the region in which the stack is run. This example creates an EC2 security group
8
+ for the instance to give you SSH access. **WARNING** This template creates an Amazon
9
+ EC2 instance. You will be billed for the AWS resources used if you create a stack
10
+ from this template.'
11
+ Parameters:
12
+ KeyName:
13
+ Description: Name of an existing EC2 KeyPair to enable SSH access to the instance
14
+ Type: AWS::EC2::KeyPair::KeyName
15
+ ConstraintDescription: must be the name of an existing EC2 KeyPair.
16
+ InstanceType:
17
+ Description: WebServer EC2 instance type
18
+ Type: String
19
+ Default: t2.small
20
+ AllowedValues:
21
+ - t1.micro
22
+ - t2.nano
23
+ - t2.micro
24
+ - t2.small
25
+ - t2.medium
26
+ - t2.large
27
+ - m1.small
28
+ - m1.medium
29
+ - m1.large
30
+ - m1.xlarge
31
+ - m2.xlarge
32
+ - m2.2xlarge
33
+ - m2.4xlarge
34
+ - m3.medium
35
+ - m3.large
36
+ - m3.xlarge
37
+ - m3.2xlarge
38
+ - m4.large
39
+ - m4.xlarge
40
+ - m4.2xlarge
41
+ - m4.4xlarge
42
+ - m4.10xlarge
43
+ - c1.medium
44
+ - c1.xlarge
45
+ - c3.large
46
+ - c3.xlarge
47
+ - c3.2xlarge
48
+ - c3.4xlarge
49
+ - c3.8xlarge
50
+ - c4.large
51
+ - c4.xlarge
52
+ - c4.2xlarge
53
+ - c4.4xlarge
54
+ - c4.8xlarge
55
+ - g2.2xlarge
56
+ - g2.8xlarge
57
+ - r3.large
58
+ - r3.xlarge
59
+ - r3.2xlarge
60
+ - r3.4xlarge
61
+ - r3.8xlarge
62
+ - i2.xlarge
63
+ - i2.2xlarge
64
+ - i2.4xlarge
65
+ - i2.8xlarge
66
+ - d2.xlarge
67
+ - d2.2xlarge
68
+ - d2.4xlarge
69
+ - d2.8xlarge
70
+ - hi1.4xlarge
71
+ - hs1.8xlarge
72
+ - cr1.8xlarge
73
+ - cc2.8xlarge
74
+ - cg1.4xlarge
75
+ ConstraintDescription: must be a valid EC2 instance type.
76
+ SSHLocation:
77
+ Description: The IP address range that can be used to SSH to the EC2 instances
78
+ Type: String
79
+ MinLength: '9'
80
+ MaxLength: '18'
81
+ Default: 0.0.0.0/0
82
+ AllowedPattern: "(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})/(\\d{1,2})"
83
+ ConstraintDescription: must be a valid IP CIDR range of the form x.x.x.x/x.
84
+ <% if @route53 %>
85
+ HostedZoneName:
86
+ Description: The route53 HostedZoneName. For example, "mydomain.com." Don't forget the period at the end.
87
+ Type: String
88
+ Subdomain:
89
+ Description: The subdomain of the dns entry. For example, hello -> hello.mydomain.com, hello is the subdomain.
90
+ Type: String
91
+ <% end %>
92
+ Mappings:
93
+ AWSInstanceType2Arch:
94
+ t1.micro:
95
+ Arch: PV64
96
+ t2.nano:
97
+ Arch: HVM64
98
+ t2.micro:
99
+ Arch: HVM64
100
+ t2.small:
101
+ Arch: HVM64
102
+ t2.medium:
103
+ Arch: HVM64
104
+ t2.large:
105
+ Arch: HVM64
106
+ m1.small:
107
+ Arch: PV64
108
+ m1.medium:
109
+ Arch: PV64
110
+ m1.large:
111
+ Arch: PV64
112
+ m1.xlarge:
113
+ Arch: PV64
114
+ m2.xlarge:
115
+ Arch: PV64
116
+ m2.2xlarge:
117
+ Arch: PV64
118
+ m2.4xlarge:
119
+ Arch: PV64
120
+ m3.medium:
121
+ Arch: HVM64
122
+ m3.large:
123
+ Arch: HVM64
124
+ m3.xlarge:
125
+ Arch: HVM64
126
+ m3.2xlarge:
127
+ Arch: HVM64
128
+ m4.large:
129
+ Arch: HVM64
130
+ m4.xlarge:
131
+ Arch: HVM64
132
+ m4.2xlarge:
133
+ Arch: HVM64
134
+ m4.4xlarge:
135
+ Arch: HVM64
136
+ m4.10xlarge:
137
+ Arch: HVM64
138
+ c1.medium:
139
+ Arch: PV64
140
+ c1.xlarge:
141
+ Arch: PV64
142
+ c3.large:
143
+ Arch: HVM64
144
+ c3.xlarge:
145
+ Arch: HVM64
146
+ c3.2xlarge:
147
+ Arch: HVM64
148
+ c3.4xlarge:
149
+ Arch: HVM64
150
+ c3.8xlarge:
151
+ Arch: HVM64
152
+ c4.large:
153
+ Arch: HVM64
154
+ c4.xlarge:
155
+ Arch: HVM64
156
+ c4.2xlarge:
157
+ Arch: HVM64
158
+ c4.4xlarge:
159
+ Arch: HVM64
160
+ c4.8xlarge:
161
+ Arch: HVM64
162
+ g2.2xlarge:
163
+ Arch: HVMG2
164
+ g2.8xlarge:
165
+ Arch: HVMG2
166
+ r3.large:
167
+ Arch: HVM64
168
+ r3.xlarge:
169
+ Arch: HVM64
170
+ r3.2xlarge:
171
+ Arch: HVM64
172
+ r3.4xlarge:
173
+ Arch: HVM64
174
+ r3.8xlarge:
175
+ Arch: HVM64
176
+ i2.xlarge:
177
+ Arch: HVM64
178
+ i2.2xlarge:
179
+ Arch: HVM64
180
+ i2.4xlarge:
181
+ Arch: HVM64
182
+ i2.8xlarge:
183
+ Arch: HVM64
184
+ d2.xlarge:
185
+ Arch: HVM64
186
+ d2.2xlarge:
187
+ Arch: HVM64
188
+ d2.4xlarge:
189
+ Arch: HVM64
190
+ d2.8xlarge:
191
+ Arch: HVM64
192
+ hi1.4xlarge:
193
+ Arch: HVM64
194
+ hs1.8xlarge:
195
+ Arch: HVM64
196
+ cr1.8xlarge:
197
+ Arch: HVM64
198
+ cc2.8xlarge:
199
+ Arch: HVM64
200
+ AWSInstanceType2NATArch:
201
+ t1.micro:
202
+ Arch: NATPV64
203
+ t2.nano:
204
+ Arch: NATHVM64
205
+ t2.micro:
206
+ Arch: NATHVM64
207
+ t2.small:
208
+ Arch: NATHVM64
209
+ t2.medium:
210
+ Arch: NATHVM64
211
+ t2.large:
212
+ Arch: NATHVM64
213
+ m1.small:
214
+ Arch: NATPV64
215
+ m1.medium:
216
+ Arch: NATPV64
217
+ m1.large:
218
+ Arch: NATPV64
219
+ m1.xlarge:
220
+ Arch: NATPV64
221
+ m2.xlarge:
222
+ Arch: NATPV64
223
+ m2.2xlarge:
224
+ Arch: NATPV64
225
+ m2.4xlarge:
226
+ Arch: NATPV64
227
+ m3.medium:
228
+ Arch: NATHVM64
229
+ m3.large:
230
+ Arch: NATHVM64
231
+ m3.xlarge:
232
+ Arch: NATHVM64
233
+ m3.2xlarge:
234
+ Arch: NATHVM64
235
+ m4.large:
236
+ Arch: NATHVM64
237
+ m4.xlarge:
238
+ Arch: NATHVM64
239
+ m4.2xlarge:
240
+ Arch: NATHVM64
241
+ m4.4xlarge:
242
+ Arch: NATHVM64
243
+ m4.10xlarge:
244
+ Arch: NATHVM64
245
+ c1.medium:
246
+ Arch: NATPV64
247
+ c1.xlarge:
248
+ Arch: NATPV64
249
+ c3.large:
250
+ Arch: NATHVM64
251
+ c3.xlarge:
252
+ Arch: NATHVM64
253
+ c3.2xlarge:
254
+ Arch: NATHVM64
255
+ c3.4xlarge:
256
+ Arch: NATHVM64
257
+ c3.8xlarge:
258
+ Arch: NATHVM64
259
+ c4.large:
260
+ Arch: NATHVM64
261
+ c4.xlarge:
262
+ Arch: NATHVM64
263
+ c4.2xlarge:
264
+ Arch: NATHVM64
265
+ c4.4xlarge:
266
+ Arch: NATHVM64
267
+ c4.8xlarge:
268
+ Arch: NATHVM64
269
+ g2.2xlarge:
270
+ Arch: NATHVMG2
271
+ g2.8xlarge:
272
+ Arch: NATHVMG2
273
+ r3.large:
274
+ Arch: NATHVM64
275
+ r3.xlarge:
276
+ Arch: NATHVM64
277
+ r3.2xlarge:
278
+ Arch: NATHVM64
279
+ r3.4xlarge:
280
+ Arch: NATHVM64
281
+ r3.8xlarge:
282
+ Arch: NATHVM64
283
+ i2.xlarge:
284
+ Arch: NATHVM64
285
+ i2.2xlarge:
286
+ Arch: NATHVM64
287
+ i2.4xlarge:
288
+ Arch: NATHVM64
289
+ i2.8xlarge:
290
+ Arch: NATHVM64
291
+ d2.xlarge:
292
+ Arch: NATHVM64
293
+ d2.2xlarge:
294
+ Arch: NATHVM64
295
+ d2.4xlarge:
296
+ Arch: NATHVM64
297
+ d2.8xlarge:
298
+ Arch: NATHVM64
299
+ hi1.4xlarge:
300
+ Arch: NATHVM64
301
+ hs1.8xlarge:
302
+ Arch: NATHVM64
303
+ cr1.8xlarge:
304
+ Arch: NATHVM64
305
+ cc2.8xlarge:
306
+ Arch: NATHVM64
307
+ AWSRegionArch2AMI:
308
+ us-east-1:
309
+ PV64: ami-2a69aa47
310
+ HVM64: ami-6869aa05
311
+ HVMG2: ami-61e27177
312
+ us-west-2:
313
+ PV64: ami-7f77b31f
314
+ HVM64: ami-7172b611
315
+ HVMG2: ami-60aa3700
316
+ us-west-1:
317
+ PV64: ami-a2490dc2
318
+ HVM64: ami-31490d51
319
+ HVMG2: ami-4b694d2b
320
+ eu-west-1:
321
+ PV64: ami-4cdd453f
322
+ HVM64: ami-f9dd458a
323
+ HVMG2: ami-2955524f
324
+ eu-west-2:
325
+ PV64: NOT_SUPPORTED
326
+ HVM64: ami-886369ec
327
+ HVMG2: NOT_SUPPORTED
328
+ eu-central-1:
329
+ PV64: ami-6527cf0a
330
+ HVM64: ami-ea26ce85
331
+ HVMG2: ami-81ac71ee
332
+ ap-northeast-1:
333
+ PV64: ami-3e42b65f
334
+ HVM64: ami-374db956
335
+ HVMG2: ami-46220c21
336
+ ap-northeast-2:
337
+ PV64: NOT_SUPPORTED
338
+ HVM64: ami-2b408b45
339
+ HVMG2: NOT_SUPPORTED
340
+ ap-southeast-1:
341
+ PV64: ami-df9e4cbc
342
+ HVM64: ami-a59b49c6
343
+ HVMG2: ami-c212aba1
344
+ ap-southeast-2:
345
+ PV64: ami-63351d00
346
+ HVM64: ami-dc361ebf
347
+ HVMG2: ami-0ad2db69
348
+ ap-south-1:
349
+ PV64: NOT_SUPPORTED
350
+ HVM64: ami-ffbdd790
351
+ HVMG2: ami-ca3042a5
352
+ us-east-2:
353
+ PV64: NOT_SUPPORTED
354
+ HVM64: ami-f6035893
355
+ HVMG2: NOT_SUPPORTED
356
+ ca-central-1:
357
+ PV64: NOT_SUPPORTED
358
+ HVM64: ami-730ebd17
359
+ HVMG2: NOT_SUPPORTED
360
+ sa-east-1:
361
+ PV64: ami-1ad34676
362
+ HVM64: ami-6dd04501
363
+ HVMG2: NOT_SUPPORTED
364
+ cn-north-1:
365
+ PV64: ami-77559f1a
366
+ HVM64: ami-8e6aa0e3
367
+ HVMG2: NOT_SUPPORTED
368
+ Resources:
369
+ EC2Instance:
370
+ Type: AWS::EC2::Instance
371
+ Properties:
372
+ InstanceType:
373
+ Ref: InstanceType
374
+ SecurityGroups:
375
+ - Ref: InstanceSecurityGroup
376
+ KeyName:
377
+ Ref: KeyName
378
+ ImageId:
379
+ Fn::FindInMap:
380
+ - AWSRegionArch2AMI
381
+ - Ref: AWS::Region
382
+ - Fn::FindInMap:
383
+ - AWSInstanceType2Arch
384
+ - Ref: InstanceType
385
+ - Arch
386
+ InstanceSecurityGroup:
387
+ Type: AWS::EC2::SecurityGroup
388
+ Properties:
389
+ GroupDescription: Enable SSH access via port 22
390
+ SecurityGroupIngress:
391
+ - IpProtocol: tcp
392
+ FromPort: '22'
393
+ ToPort: '22'
394
+ CidrIp:
395
+ Ref: SSHLocation
396
+ <% if @route53 %>
397
+ DnsRecord:
398
+ Type: AWS::Route53::RecordSet
399
+ Properties:
400
+ HostedZoneName: !Ref 'HostedZoneName'
401
+ Comment: DNS name for my instance.
402
+ Name: !Join ['', [!Ref 'Subdomain', ., !Ref 'HostedZoneName']]
403
+ Type: CNAME
404
+ TTL: '900'
405
+ ResourceRecords:
406
+ - !GetAtt EC2Instance.PublicIp
407
+ <% end %>
408
+ Outputs:
409
+ InstanceId:
410
+ Description: InstanceId of the newly created EC2 instance
411
+ Value:
412
+ Ref: EC2Instance
413
+ AZ:
414
+ Description: Availability Zone of the newly created EC2 instance
415
+ Value:
416
+ Fn::GetAtt:
417
+ - EC2Instance
418
+ - AvailabilityZone
419
+ PublicDNS:
420
+ Description: Public DNSName of the newly created EC2 instance
421
+ Value:
422
+ Fn::GetAtt:
423
+ - EC2Instance
424
+ - PublicDnsName
425
+ PublicIP:
426
+ Description: Public IP address of the newly created EC2 instance
427
+ Value:
428
+ Fn::GetAtt:
429
+ - EC2Instance
430
+ - PublicIp
@@ -8,9 +8,11 @@ Gem::Specification.new do |gem|
8
8
  gem.summary = %q{Lono is a CloudFormation Template ruby generator. Lono generates CloudFormation templates based on ERB templates.}
9
9
  gem.homepage = "http://github.com/tongueroo/lono"
10
10
 
11
- gem.files = `git ls-files`.split($\) + Dir.glob("vendor/**/*")
11
+ files = `git ls-files`.split($\) + Dir.glob("vendor/**/*")
12
+ files = files.reject { |p| p =~ /^docs/ }
13
+ gem.files = files
12
14
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
13
- gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
15
+ gem.test_files = gem.files.grep(%r{^(test|spec|features|docs)/})
14
16
  gem.name = "lono"
15
17
  gem.require_paths = ["lib"]
16
18
  gem.version = Lono::VERSION
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lono
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.4
4
+ version: 2.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-06 00:00:00.000000000 Z
11
+ date: 2017-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -222,6 +222,7 @@ files:
222
222
  - ".ruby-version"
223
223
  - ".travis.yml"
224
224
  - CHANGELOG.md
225
+ - CONTRIBUTING.md
225
226
  - Gemfile
226
227
  - Guardfile
227
228
  - LICENSE
@@ -240,6 +241,7 @@ files:
240
241
  - lib/lono/cfn/preview.rb
241
242
  - lib/lono/cfn/update.rb
242
243
  - lib/lono/cfn/util.rb
244
+ - lib/lono/clean.rb
243
245
  - lib/lono/cli.rb
244
246
  - lib/lono/command.rb
245
247
  - lib/lono/help.rb
@@ -272,7 +274,9 @@ files:
272
274
  - lib/starter_projects/yaml_project/config/lono.rb
273
275
  - lib/starter_projects/yaml_project/config/lono/api.rb
274
276
  - lib/starter_projects/yaml_project/params/api-web-prod.txt
277
+ - lib/starter_projects/yaml_project/params/example.txt
275
278
  - lib/starter_projects/yaml_project/templates/db.yml.erb
279
+ - lib/starter_projects/yaml_project/templates/example.yml.erb
276
280
  - lib/starter_projects/yaml_project/templates/partial/host_record.yml.erb
277
281
  - lib/starter_projects/yaml_project/templates/partial/server.yml.erb
278
282
  - lib/starter_projects/yaml_project/templates/partial/user_data/bootstrap.sh.erb