lono 3.5.0 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (186) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +15 -4
  3. data/.rspec +1 -0
  4. data/CHANGELOG.md +15 -1
  5. data/Gemfile +3 -3
  6. data/Guardfile +17 -8
  7. data/{LICENSE → LICENSE.txt} +1 -1
  8. data/README.md +20 -12
  9. data/Rakefile +1 -2
  10. data/{bin → exe}/lono +1 -0
  11. data/lib/lono.rb +12 -9
  12. data/lib/lono/cfn.rb +7 -9
  13. data/lib/lono/cfn/{aws_services.rb → aws_service.rb} +1 -1
  14. data/lib/lono/cfn/base.rb +41 -38
  15. data/lib/lono/cfn/create.rb +6 -2
  16. data/lib/lono/cfn/delete.rb +2 -2
  17. data/lib/lono/cfn/diff.rb +1 -1
  18. data/lib/lono/cfn/preview.rb +26 -15
  19. data/lib/lono/cfn/update.rb +11 -9
  20. data/lib/lono/cfn/util.rb +3 -3
  21. data/lib/lono/clean.rb +1 -1
  22. data/lib/lono/cli.rb +71 -39
  23. data/lib/lono/command.rb +42 -18
  24. data/lib/lono/completer.rb +162 -0
  25. data/lib/lono/completer/script.rb +6 -0
  26. data/lib/lono/completer/script.sh +10 -0
  27. data/lib/lono/completion.rb +15 -0
  28. data/lib/lono/core.rb +23 -9
  29. data/lib/lono/core/config.rb +20 -0
  30. data/lib/lono/default/settings.yml +33 -13
  31. data/lib/lono/help.rb +6 -79
  32. data/lib/lono/help/cfn.md +6 -0
  33. data/lib/lono/help/cfn/create.md +22 -0
  34. data/lib/lono/help/cfn/delete.md +5 -0
  35. data/lib/lono/help/cfn/diff.md +5 -0
  36. data/lib/lono/help/cfn/download.md +5 -0
  37. data/lib/lono/help/cfn/preview.md +11 -0
  38. data/lib/lono/help/cfn/update.md +21 -0
  39. data/lib/lono/help/completion.md +22 -0
  40. data/lib/lono/help/completion_script.md +3 -0
  41. data/lib/lono/help/generate.md +7 -0
  42. data/lib/lono/help/hello.md +5 -0
  43. data/lib/lono/help/import.md +7 -0
  44. data/lib/lono/help/inspect.md +4 -0
  45. data/lib/lono/help/inspect/depends.md +3 -0
  46. data/lib/lono/help/inspect/summary.md +3 -0
  47. data/lib/lono/help/new.md +8 -0
  48. data/lib/lono/help/param.md +3 -0
  49. data/lib/lono/{param/help.rb → help/param/generate.md} +1 -9
  50. data/lib/lono/help/script/build.md +5 -0
  51. data/lib/lono/help/script/upload.md +8 -0
  52. data/lib/lono/help/template.md +4 -0
  53. data/lib/lono/help/template/bashify.md +4 -0
  54. data/lib/lono/help/template/generate.md +7 -0
  55. data/lib/lono/help/user_data.md +3 -0
  56. data/lib/lono/importer.rb +43 -20
  57. data/lib/lono/inspector.rb +2 -19
  58. data/lib/lono/inspector/base.rb +2 -2
  59. data/lib/lono/inspector/{depends.rb → graph.rb} +3 -3
  60. data/lib/lono/inspector/summary.rb +1 -1
  61. data/lib/lono/new.rb +79 -26
  62. data/lib/lono/new/helper.rb +16 -0
  63. data/lib/lono/new/message.rb +35 -0
  64. data/lib/lono/param.rb +1 -2
  65. data/lib/lono/param/generator.rb +34 -86
  66. data/lib/lono/project_checker.rb +35 -40
  67. data/lib/lono/script.rb +19 -0
  68. data/lib/lono/script/base.rb +9 -0
  69. data/lib/lono/script/build.rb +73 -0
  70. data/lib/lono/script/upload.rb +81 -0
  71. data/lib/lono/sequence.rb +33 -0
  72. data/lib/lono/setting.rb +83 -0
  73. data/lib/lono/template.rb +8 -9
  74. data/lib/lono/template/{aws_services.rb → aws_service.rb} +1 -1
  75. data/lib/lono/template/context.rb +73 -0
  76. data/lib/lono/template/dsl.rb +63 -64
  77. data/lib/lono/template/helper.rb +201 -0
  78. data/lib/lono/template/template.rb +29 -221
  79. data/lib/lono/template/upload.rb +41 -33
  80. data/lib/lono/upgrade4.rb +175 -0
  81. data/lib/lono/user_data.rb +31 -0
  82. data/lib/lono/version.rb +1 -1
  83. data/lib/starter_projects/autoscaling/.gitignore +1 -0
  84. data/lib/starter_projects/{json_project → autoscaling}/Gemfile +0 -0
  85. data/lib/starter_projects/{yaml_project → autoscaling}/Guardfile +0 -0
  86. data/lib/starter_projects/autoscaling/README.md +118 -0
  87. data/lib/starter_projects/autoscaling/app/definitions/base.rb +2 -0
  88. data/lib/starter_projects/autoscaling/app/templates/autoscaling.yml +682 -0
  89. data/lib/starter_projects/autoscaling/config/params/base/autoscaling.txt +6 -0
  90. data/lib/starter_projects/autoscaling/config/settings.yml +33 -0
  91. data/lib/starter_projects/ec2/.gitignore +1 -0
  92. data/lib/starter_projects/{yaml_project → ec2}/Gemfile +0 -0
  93. data/lib/starter_projects/{json_project → ec2}/Guardfile +1 -1
  94. data/lib/starter_projects/ec2/README.md +86 -0
  95. data/lib/starter_projects/ec2/app/definitions/base.rb +2 -0
  96. data/lib/starter_projects/ec2/app/definitions/development.rb +1 -0
  97. data/lib/starter_projects/ec2/app/definitions/production.rb +1 -0
  98. data/lib/starter_projects/{yaml_project → ec2/app}/helpers/my_custom_helper.rb +0 -0
  99. data/lib/starter_projects/{json_project/templates/user_data/app.sh → ec2/app/partials/user_data/bootstrap.sh} +1 -2
  100. data/lib/starter_projects/{yaml_project → ec2/app}/templates/example.yml +0 -0
  101. data/lib/starter_projects/{json_project/params/base/api-web.txt → ec2/config/params/base/example.txt} +0 -0
  102. data/lib/starter_projects/ec2/config/params/development/example.txt +3 -0
  103. data/lib/starter_projects/ec2/config/params/production/example.txt +2 -0
  104. data/lib/starter_projects/ec2/config/settings.yml +33 -0
  105. data/lib/starter_projects/ec2/config/variables/base.rb +3 -0
  106. data/lib/starter_projects/ec2/config/variables/development.rb +2 -0
  107. data/lib/starter_projects/ec2/config/variables/production.rb +2 -0
  108. data/lib/starter_projects/ec2/welcome.txt +8 -0
  109. data/lib/starter_projects/skeleton/.gitignore +1 -0
  110. data/lib/starter_projects/skeleton/Gemfile +3 -0
  111. data/lib/starter_projects/skeleton/Guardfile +12 -0
  112. data/lib/starter_projects/skeleton/README.md +53 -0
  113. data/{spec/fixtures/my_project/templates/.gitkeep → lib/starter_projects/skeleton/app/definitions/base.rb} +0 -0
  114. data/lib/starter_projects/skeleton/config/settings.yml +33 -0
  115. data/lib/starter_projects/skeleton/welcome.txt +7 -0
  116. data/lono.gemspec +12 -10
  117. data/spec/fixtures/lono_project/.gitignore +1 -0
  118. data/spec/fixtures/lono_project/Gemfile +3 -0
  119. data/spec/fixtures/lono_project/Guardfile +12 -0
  120. data/spec/fixtures/lono_project/app/definitions/base.rb +10 -0
  121. data/spec/fixtures/lono_project/app/definitions/base/more.rb +7 -0
  122. data/spec/fixtures/lono_project/app/definitions/development.rb +1 -0
  123. data/spec/fixtures/lono_project/app/definitions/production.rb +1 -0
  124. data/spec/fixtures/lono_project/app/helpers/custom_helper.rb +5 -0
  125. data/spec/fixtures/lono_project/app/partials/security_group.yml +10 -0
  126. data/{lib/starter_projects/yaml_project/templates/partial → spec/fixtures/lono_project/app/partials}/user_data/bootstrap.sh +8 -2
  127. data/spec/fixtures/lono_project/app/templates/example.yml +50 -0
  128. data/{lib/starter_projects/yaml_project/params/base/api-web-prod.txt → spec/fixtures/lono_project/config/params/base/example.txt} +1 -0
  129. data/spec/fixtures/lono_project/config/params/development/example.txt +1 -0
  130. data/spec/fixtures/lono_project/config/params/production/example.txt +1 -0
  131. data/spec/fixtures/lono_project/config/settings.yml +31 -0
  132. data/spec/fixtures/lono_project/config/variables/base.rb +3 -0
  133. data/spec/fixtures/lono_project/config/variables/development.rb +1 -0
  134. data/spec/fixtures/lono_project/config/variables/production.rb +1 -0
  135. data/spec/fixtures/params/envonly/params/{prod → development}/network.txt +0 -0
  136. data/spec/fixtures/params/overlay/params/{prod → development}/network.txt +0 -0
  137. data/spec/fixtures/raw_templates/aws-waf-security-automations.template +2 -2
  138. data/spec/lib/lono/cfn_spec.rb +6 -9
  139. data/spec/lib/lono/cli_spec.rb +44 -0
  140. data/spec/lib/lono/completion_spec.rb +17 -0
  141. data/spec/lib/lono/inspect_spec.rb +6 -15
  142. data/spec/lib/lono/param/generator_spec.rb +45 -26
  143. data/spec/lib/lono/param_spec.rb +1 -3
  144. data/spec/lib/lono/setting_spec.rb +47 -0
  145. data/spec/lib/lono/template/dsl_spec.rb +33 -157
  146. data/spec/lib/lono/template_spec.rb +4 -16
  147. data/spec/spec_helper.rb +45 -14
  148. metadata +168 -82
  149. data/.coveralls.yml +0 -1
  150. data/lib/lono/cfn/help.rb +0 -103
  151. data/lib/lono/current_region.rb +0 -42
  152. data/lib/lono/inspector/help.rb +0 -21
  153. data/lib/lono/settings.rb +0 -45
  154. data/lib/lono/template/help.rb +0 -25
  155. data/lib/lono/template/helpers.rb +0 -136
  156. data/lib/starter_projects/json_project/.gitignore +0 -1
  157. data/lib/starter_projects/json_project/config/templates/base/blog.rb +0 -20
  158. data/lib/starter_projects/json_project/config/templates/base/stacks.rb +0 -58
  159. data/lib/starter_projects/json_project/templates/db.json +0 -212
  160. data/lib/starter_projects/json_project/templates/partial/host_record.json +0 -28
  161. data/lib/starter_projects/json_project/templates/partial/server.json +0 -45
  162. data/lib/starter_projects/json_project/templates/user_data/db.sh +0 -39
  163. data/lib/starter_projects/json_project/templates/user_data/db2.sh +0 -2
  164. data/lib/starter_projects/json_project/templates/user_data/ruby_script.rb +0 -5
  165. data/lib/starter_projects/json_project/templates/web.json +0 -386
  166. data/lib/starter_projects/yaml_project/.gitignore +0 -1
  167. data/lib/starter_projects/yaml_project/config/templates/base/blog.rb +0 -20
  168. data/lib/starter_projects/yaml_project/config/templates/base/stacks.rb +0 -56
  169. data/lib/starter_projects/yaml_project/config/templates/prod/stacks.rb +0 -1
  170. data/lib/starter_projects/yaml_project/config/templates/stag/stacks.rb +0 -1
  171. data/lib/starter_projects/yaml_project/config/variables/base/variables.rb +0 -4
  172. data/lib/starter_projects/yaml_project/config/variables/prod/variables.rb +0 -1
  173. data/lib/starter_projects/yaml_project/config/variables/stag/variables.rb +0 -1
  174. data/lib/starter_projects/yaml_project/params/base/example.txt +0 -2
  175. data/lib/starter_projects/yaml_project/params/prod/example.txt +0 -1
  176. data/lib/starter_projects/yaml_project/params/stag/example.txt +0 -1
  177. data/lib/starter_projects/yaml_project/templates/db.yml +0 -148
  178. data/lib/starter_projects/yaml_project/templates/partial/host_record.yml +0 -14
  179. data/lib/starter_projects/yaml_project/templates/partial/server.yml +0 -59
  180. data/lib/starter_projects/yaml_project/templates/web.yml +0 -206
  181. data/spec/fixtures/my_project/config/templates/base/stacks.rb +0 -3
  182. data/spec/fixtures/my_project/params/my-stack.txt +0 -3
  183. data/spec/fixtures/my_project/templates/my-stack.yml +0 -0
  184. data/spec/lib/lono/new_spec.rb +0 -59
  185. data/spec/lib/lono/template/template_spec.rb +0 -104
  186. data/spec/lib/lono_spec.rb +0 -27
@@ -0,0 +1,6 @@
1
+ VpcId=
2
+ Subnets=
3
+ OperatorEMail=
4
+ KeyName=
5
+ #InstanceType= # optional
6
+ #SSHLocation= # optional
@@ -0,0 +1,33 @@
1
+ # More info: http://lono.cloud/docs/settings/
2
+ # The base config is specially treated. It gets included the other environments automatically.
3
+ # Yaml also directly supports merging with & and <<* syntax but doing it automatically
4
+ # for a cleaner syntax.
5
+ base:
6
+ # http://lono.cloud/docs/app-scripts/
7
+ # extract_scripts:
8
+ # to: "/opt"
9
+ # as: "ec2-user"
10
+ # If s3_folder is set then the generated templates and app/scripts will automatically
11
+ # be uploaded to s3.
12
+ # There are 2 formats for s3_folder:
13
+ # Format 1:
14
+ # s3_folder: mybucket/path/to/folder # simple string
15
+ # Format 2:
16
+ # s3_folder: # Hash options in order to support multiple AWS_PROFILEs
17
+ # default: mybucket/folder
18
+ # aws_profile1: mybucket/folder
19
+ # aws_profile2: another-bucket/storage/folder
20
+ # randomize_stack_name: true # tack on a 3 char random string at the end of the stack name for lono cfn create
21
+
22
+
23
+ development:
24
+ # When you have AWS_PROFILE set to one of these values, lono will switch to the desired
25
+ # environment. This prevents you from switching AWS_PROFILE, forgetting to
26
+ # also switch LONO_ENV, and accidentally deploying to production vs development.
27
+ # aws_profiles:
28
+ # - dev_profile1
29
+ # - dev_profile2
30
+
31
+ production:
32
+ # aws_profiles:
33
+ # - prod_profile
@@ -0,0 +1 @@
1
+ output
File without changes
@@ -8,5 +8,5 @@ end
8
8
 
9
9
  # Commented out due to CF rate limiting
10
10
  # guard "cloudformation", templates_path: "output" do
11
- # watch(%r{^output/.+\.json$})
11
+ # watch(%r{^output/.+\.yml$})
12
12
  # end
@@ -0,0 +1,86 @@
1
+ # Autoscaling Lono Example
2
+
3
+ ## Usage
4
+
5
+ Create a new project.
6
+
7
+ ```
8
+ TEMPLATE=ec2 lono new ec2
9
+ cd ec2
10
+ ```
11
+
12
+ Edit `config/params/base/ec2.txt` with your desired parameters. Here are the current contents of ``config/params/base/ec2.txt`:
13
+
14
+ ```sh
15
+ InstanceType=t2.micro
16
+ KeyName=default
17
+ ```
18
+
19
+ Then launch the stack:
20
+
21
+ ```sh
22
+ lono cfn create ec2
23
+ ```
24
+
25
+ ## How This Example Was Orginally Built
26
+
27
+ First, generate a skeleton starter lono project.
28
+
29
+ ```sh
30
+ TEMPLATE=skeleton lono new ec2
31
+ ```
32
+
33
+ Then import a standard CloudFormation template into lono. The `--name` option is used to name the template `ec2`.
34
+
35
+ ```
36
+ $ lono import https://s3-us-west-2.amazonaws.com/cloudformation-templates-us-west-2/EC2InstanceWithSecurityGroupSample.template --name ec2
37
+ => Imported CloudFormation template and lono-fied it.
38
+ Template definition added to app/definitions/base.rb
39
+ Params file created to config/params/base/ec2.txt
40
+ Template downloaded to app/templates/ec2.yml
41
+ => CloudFormation Template Summary:
42
+ Parameters:
43
+ Required:
44
+ KeyName (AWS::EC2::KeyPair::KeyName)
45
+ Optional:
46
+ InstanceType (String) Default: t2.small
47
+ SSHLocation (String) Default: 0.0.0.0/0
48
+ Resources:
49
+ 1 AWS::EC2::Instance
50
+ 1 AWS::EC2::SecurityGroup
51
+ 2 Total
52
+ Here are contents of the params config/params/base/ec2.txt file:
53
+ KeyName=
54
+ #InstanceType= # optional
55
+ #SSHLocation= # optional
56
+ ```
57
+
58
+ The template was imported from [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/sample-templates-services-us-west-2.html#w2ab2c23c48c13c15).
59
+
60
+ A starter `config/params/base/ec2.txt` was generated with required parameters emptied and optional parameters commented out. Fill in the required parameters.
61
+
62
+ ### Filling in the Parameters
63
+
64
+ You can use the following commands to set KeyName to a key that exists on your AWS account. Here we use `default` :
65
+
66
+ ```
67
+ sed "s/KeyName=/KeyName=default/" config/params/base/ec2.txt > config/params/base/ec2.txt.1
68
+ mv config/params/base/ec2.txt{.1,}
69
+ ```
70
+
71
+ Now launch the stack:
72
+
73
+ ```
74
+ lono cfn create ec2
75
+ ```
76
+
77
+ ## Commands Summarized
78
+
79
+ ```sh
80
+ lono new ec2
81
+ cd ec2
82
+ lono import https://s3-us-west-2.amazonaws.com/cloudformation-templates-us-west-2/EC2InstanceWithSecurityGroupSample.template --name ec2
83
+ sed "s/KeyName=/KeyName=default/" config/params/base/ec2.txt > config/params/base/ec2.txt.1
84
+ mv config/params/base/ec2.txt{.1,}
85
+ lono cfn create ec2 --template ec2
86
+ ```
@@ -0,0 +1,2 @@
1
+ template "example"
2
+
@@ -0,0 +1 @@
1
+ # resources that only exist in the development environment
@@ -0,0 +1 @@
1
+ # resources that only exist in the production environment
@@ -1,5 +1,4 @@
1
1
  #!/bin/bash -lexv
2
- <% stack_name = "#{@env}-#{@app}-#{@role}" %>
3
2
  exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1
4
- echo <%= stack_name %> > /tmp/stack_name
3
+ echo ${AWS::StackName} > /tmp/stack_name
5
4
  cat /proc/uptime | cut -f1 -d'.' > /tmp/time-to-boot
@@ -0,0 +1,3 @@
1
+ # parameters in here override parameters/base/example.txt for LONO_ENV=development
2
+ # Also, config/variables are available in params files
3
+ InstanceType=<%= @instance_type %>
@@ -0,0 +1,2 @@
1
+ # parameters in here override parameters/base/example.txt for LONO_ENV=production
2
+ InstanceType=t2.large
@@ -0,0 +1,33 @@
1
+ # More info: http://lono.cloud/docs/settings/
2
+ # The base config is specially treated. It gets included the other environments automatically.
3
+ # Yaml also directly supports merging with & and <<* syntax but doing it automatically
4
+ # for a cleaner syntax.
5
+ base:
6
+ # http://lono.cloud/docs/app-scripts/
7
+ # extract_scripts:
8
+ # to: "/opt"
9
+ # as: "ec2-user"
10
+ # If s3_folder is set then the generated templates and app/scripts will automatically
11
+ # be uploaded to s3.
12
+ # There are 2 formats for s3_folder:
13
+ # Format 1:
14
+ # s3_folder: mybucket/path/to/folder # simple string
15
+ # Format 2:
16
+ # s3_folder: # Hash options in order to support multiple AWS_PROFILEs
17
+ # default: mybucket/folder
18
+ # aws_profile1: mybucket/folder
19
+ # aws_profile2: another-bucket/storage/folder
20
+ # randomize_stack_name: true # tack on a 3 char random string at the end of the stack name for lono cfn create
21
+
22
+
23
+ development:
24
+ # When you have AWS_PROFILE set to one of these values, lono will switch to the desired
25
+ # environment. This prevents you from switching AWS_PROFILE, forgetting to
26
+ # also switch LONO_ENV, and accidentally deploying to production vs development.
27
+ # aws_profiles:
28
+ # - dev_profile1
29
+ # - dev_profile2
30
+
31
+ production:
32
+ # aws_profiles:
33
+ # - prod_profile
@@ -0,0 +1,3 @@
1
+ @ami = "ami-123"
2
+ @override = "base"
3
+ @instance_type = "t2.micro"
@@ -0,0 +1,2 @@
1
+ # variables in here override variables/base.rb for LONO_ENV=development
2
+ @override = "development-override"
@@ -0,0 +1,2 @@
1
+ # variables in here override variables/base.rb for LONO_ENV=production
2
+ @override = "production-override"
@@ -0,0 +1,8 @@
1
+ The example template uses a keypair named default. Be sure that keypair exists. Or you can adjust the KeyName parameter in config/params/base/example.txt. Here are contents of the file:
2
+
3
+ InstanceType=t2.micro
4
+ KeyName=default
5
+
6
+ To launch an example CloudFormation stack:
7
+
8
+ lono cfn create example
@@ -0,0 +1 @@
1
+ output
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem 'lono'
@@ -0,0 +1,12 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ guard "lono" do
5
+ watch(%r{^config/lono.rb$})
6
+ watch(%r{^templates/.*$})
7
+ end
8
+
9
+ # Commented out due to CF rate limiting
10
+ # guard "cloudformation", templates_path: "output" do
11
+ # watch(%r{^output/.+\.yml$})
12
+ # end
@@ -0,0 +1,53 @@
1
+ # Lono CloudFormation Starter README
2
+
3
+ This folder contains the code that represents your infrastructure built with CloudFormation.
4
+
5
+ ## Overview
6
+
7
+ The CloudFormations templates are generated by a tool called [lono](http://lono.cloud/).
8
+
9
+ ## Updating the Infrastructure
10
+
11
+ The general steps to update the infrastructure:
12
+
13
+ 1. Edit the files in this repo
14
+ 2. Generate the CloudFormation templates
15
+ 3. Update the stack with the changes
16
+
17
+ Steps 2-3 are automated with lono and performed together with:
18
+
19
+ ```bash
20
+ lono cfn update STACK_NAME --iam --sure
21
+ ```
22
+
23
+ ## Generating the templates
24
+
25
+ If you would like to just generate the templates and not update the CloudFormation stack you can do so with:
26
+
27
+ ```
28
+ lono generate
29
+ ```
30
+
31
+ ## Importing Templates
32
+
33
+ You can also get started quickly by importing other CloudFormration templates into lono. For example:
34
+
35
+ ```
36
+ lono import https://s3-us-west-2.amazonaws.com/cloudformation-templates-us-west-2/EC2InstanceWithSecurityGroupSample.template --name ec2
37
+ ```
38
+
39
+ After importing edit the generated param file in the `config/params/base` folder. Then you can launch the stack:
40
+
41
+ ```
42
+ lono cfn create ec2
43
+ ```
44
+
45
+ ## More help
46
+
47
+ You can get help by adding `-h` to the end of commands.
48
+
49
+ ```sh
50
+ lono cfn update -h
51
+ ```
52
+
53
+ Help is also provided in the [Lono Docs](http://lono.cloud/docs/directory-structure/).
@@ -0,0 +1,33 @@
1
+ # More info: http://lono.cloud/docs/settings/
2
+ # The base config is specially treated. It gets included the other environments automatically.
3
+ # Yaml also directly supports merging with & and <<* syntax but doing it automatically
4
+ # for a cleaner syntax.
5
+ base:
6
+ # http://lono.cloud/docs/app-scripts/
7
+ # extract_scripts:
8
+ # to: "/opt"
9
+ # as: "ec2-user"
10
+ # If s3_folder is set then the generated templates and app/scripts will automatically
11
+ # be uploaded to s3.
12
+ # There are 2 formats for s3_folder:
13
+ # Format 1:
14
+ # s3_folder: mybucket/path/to/folder # simple string
15
+ # Format 2:
16
+ # s3_folder: # Hash options in order to support multiple AWS_PROFILEs
17
+ # default: mybucket/path
18
+ # aws_profile1: mybucket/path
19
+ # aws_profile2: another-bucket/storage/path
20
+ # randomize_stack_name: true # tack on a 3 char random string at the end of the stack name for lono cfn create
21
+
22
+
23
+ development:
24
+ # When you have AWS_PROFILE set to one of these values, lono will switch to the desired
25
+ # environment. This prevents you from switching AWS_PROFILE, forgetting to
26
+ # also switch LONO_ENV, and accidentally deploying to production vs development.
27
+ # aws_profiles:
28
+ # - dev_profile1
29
+ # - dev_profile2
30
+
31
+ production:
32
+ # aws_profiles:
33
+ # - prod_profile
@@ -0,0 +1,7 @@
1
+ Add and edit templates to your project. When you are ready to launch a CloudFormation stack run:
2
+
3
+ lono cfn create STACK_NAME
4
+
5
+ You can also get started quickly by importing other CloudFormration templates into lono. For example:
6
+
7
+ lono import https://s3-us-west-2.amazonaws.com/cloudformation-templates-us-west-2/EC2InstanceWithSecurityGroupSample.template --name ec2
data/lono.gemspec CHANGED
@@ -4,32 +4,34 @@ require_relative "lib/lono/version"
4
4
  Gem::Specification.new do |gem|
5
5
  gem.authors = ["Tung Nguyen"]
6
6
  gem.email = ["tongueroo@gmail.com"]
7
- gem.description = %q{Lono is a CloudFormation Template ruby generator. Lono generates CloudFormation templates based on ERB templates.}
8
7
  gem.summary = %q{Lono is a CloudFormation Template ruby generator. Lono generates CloudFormation templates based on ERB templates.}
9
8
  gem.homepage = "http://github.com/tongueroo/lono"
10
9
 
11
10
  files = `git ls-files`.split($\) + Dir.glob("vendor/**/*")
12
11
  files = files.reject { |p| p =~ /^docs/ }
13
12
  gem.files = files
14
- gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
13
+ gem.bindir = "exe"
14
+ gem.executables = gem.files.grep(%r{^exe/}).map{ |f| File.basename(f) }
15
15
  gem.test_files = gem.files.grep(%r{^(test|spec|features|docs)/})
16
16
  gem.name = "lono"
17
17
  gem.require_paths = ["lib"]
18
18
  gem.version = Lono::VERSION
19
19
  gem.license = "MIT"
20
20
 
21
- gem.add_dependency "json"
22
- gem.add_dependency "thor"
21
+ gem.add_dependency "activesupport"
22
+ gem.add_dependency "aws-sdk-cloudformation"
23
+ gem.add_dependency "aws-sdk-s3"
24
+ gem.add_dependency "colorize"
25
+ gem.add_dependency "filesize"
26
+ gem.add_dependency "graph" # lono graph command dependency
23
27
  gem.add_dependency "guard"
24
- gem.add_dependency "rb-fsevent"
25
28
  gem.add_dependency "guard-cloudformation"
26
29
  gem.add_dependency "guard-lono"
27
- gem.add_dependency "colorize"
28
30
  gem.add_dependency "hashie"
29
- gem.add_dependency "aws-sdk-cloudformation"
30
- gem.add_dependency "aws-sdk-s3"
31
- gem.add_dependency "activesupport"
32
- gem.add_dependency "graph" # lono inspect depends
31
+ gem.add_dependency "json"
32
+ gem.add_dependency "rb-fsevent"
33
+ gem.add_dependency "thor"
34
+ gem.add_dependency "render_me_pretty"
33
35
  # gem.add_dependency "plissken" # dependency for vendor/lono-params
34
36
  # using the vendor fork version: https://github.com/tongueroo/plissken
35
37
  # until https://github.com/futurechimp/plissken/pull/6 gets merged
@@ -0,0 +1 @@
1
+ output
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem 'lono'
@@ -0,0 +1,12 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ guard "lono" do
5
+ watch(%r{^config/lono.rb$})
6
+ watch(%r{^templates/.*$})
7
+ end
8
+
9
+ # Commented out due to CF rate limiting
10
+ # guard "cloudformation", templates_path: "output" do
11
+ # watch(%r{^output/.+\.yml$})
12
+ # end
@@ -0,0 +1,10 @@
1
+ template "example" # simple single ec2 instance
2
+
3
+ # template "parent"
4
+ # template "network"
5
+ # template "autoscaling" do
6
+ # source "asg"
7
+ # variables(
8
+ # root_volume_size: "8"
9
+ # )
10
+ # end
@@ -0,0 +1,7 @@
1
+ # more template declaration examples
2
+ # This time in the base folder
3
+
4
+ # simple single ec2 instance
5
+ template "subfolder/example" do
6
+ source "example"
7
+ end