lono 3.5.0 → 4.0.0
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/.gitignore +15 -4
- data/.rspec +1 -0
- data/CHANGELOG.md +15 -1
- data/Gemfile +3 -3
- data/Guardfile +17 -8
- data/{LICENSE → LICENSE.txt} +1 -1
- data/README.md +20 -12
- data/Rakefile +1 -2
- data/{bin → exe}/lono +1 -0
- data/lib/lono.rb +12 -9
- data/lib/lono/cfn.rb +7 -9
- data/lib/lono/cfn/{aws_services.rb → aws_service.rb} +1 -1
- data/lib/lono/cfn/base.rb +41 -38
- data/lib/lono/cfn/create.rb +6 -2
- data/lib/lono/cfn/delete.rb +2 -2
- data/lib/lono/cfn/diff.rb +1 -1
- data/lib/lono/cfn/preview.rb +26 -15
- data/lib/lono/cfn/update.rb +11 -9
- data/lib/lono/cfn/util.rb +3 -3
- data/lib/lono/clean.rb +1 -1
- data/lib/lono/cli.rb +71 -39
- data/lib/lono/command.rb +42 -18
- data/lib/lono/completer.rb +162 -0
- data/lib/lono/completer/script.rb +6 -0
- data/lib/lono/completer/script.sh +10 -0
- data/lib/lono/completion.rb +15 -0
- data/lib/lono/core.rb +23 -9
- data/lib/lono/core/config.rb +20 -0
- data/lib/lono/default/settings.yml +33 -13
- data/lib/lono/help.rb +6 -79
- data/lib/lono/help/cfn.md +6 -0
- data/lib/lono/help/cfn/create.md +22 -0
- data/lib/lono/help/cfn/delete.md +5 -0
- data/lib/lono/help/cfn/diff.md +5 -0
- data/lib/lono/help/cfn/download.md +5 -0
- data/lib/lono/help/cfn/preview.md +11 -0
- data/lib/lono/help/cfn/update.md +21 -0
- data/lib/lono/help/completion.md +22 -0
- data/lib/lono/help/completion_script.md +3 -0
- data/lib/lono/help/generate.md +7 -0
- data/lib/lono/help/hello.md +5 -0
- data/lib/lono/help/import.md +7 -0
- data/lib/lono/help/inspect.md +4 -0
- data/lib/lono/help/inspect/depends.md +3 -0
- data/lib/lono/help/inspect/summary.md +3 -0
- data/lib/lono/help/new.md +8 -0
- data/lib/lono/help/param.md +3 -0
- data/lib/lono/{param/help.rb → help/param/generate.md} +1 -9
- data/lib/lono/help/script/build.md +5 -0
- data/lib/lono/help/script/upload.md +8 -0
- data/lib/lono/help/template.md +4 -0
- data/lib/lono/help/template/bashify.md +4 -0
- data/lib/lono/help/template/generate.md +7 -0
- data/lib/lono/help/user_data.md +3 -0
- data/lib/lono/importer.rb +43 -20
- data/lib/lono/inspector.rb +2 -19
- data/lib/lono/inspector/base.rb +2 -2
- data/lib/lono/inspector/{depends.rb → graph.rb} +3 -3
- data/lib/lono/inspector/summary.rb +1 -1
- data/lib/lono/new.rb +79 -26
- data/lib/lono/new/helper.rb +16 -0
- data/lib/lono/new/message.rb +35 -0
- data/lib/lono/param.rb +1 -2
- data/lib/lono/param/generator.rb +34 -86
- data/lib/lono/project_checker.rb +35 -40
- data/lib/lono/script.rb +19 -0
- data/lib/lono/script/base.rb +9 -0
- data/lib/lono/script/build.rb +73 -0
- data/lib/lono/script/upload.rb +81 -0
- data/lib/lono/sequence.rb +33 -0
- data/lib/lono/setting.rb +83 -0
- data/lib/lono/template.rb +8 -9
- data/lib/lono/template/{aws_services.rb → aws_service.rb} +1 -1
- data/lib/lono/template/context.rb +73 -0
- data/lib/lono/template/dsl.rb +63 -64
- data/lib/lono/template/helper.rb +201 -0
- data/lib/lono/template/template.rb +29 -221
- data/lib/lono/template/upload.rb +41 -33
- data/lib/lono/upgrade4.rb +175 -0
- data/lib/lono/user_data.rb +31 -0
- data/lib/lono/version.rb +1 -1
- data/lib/starter_projects/autoscaling/.gitignore +1 -0
- data/lib/starter_projects/{json_project → autoscaling}/Gemfile +0 -0
- data/lib/starter_projects/{yaml_project → autoscaling}/Guardfile +0 -0
- data/lib/starter_projects/autoscaling/README.md +118 -0
- data/lib/starter_projects/autoscaling/app/definitions/base.rb +2 -0
- data/lib/starter_projects/autoscaling/app/templates/autoscaling.yml +682 -0
- data/lib/starter_projects/autoscaling/config/params/base/autoscaling.txt +6 -0
- data/lib/starter_projects/autoscaling/config/settings.yml +33 -0
- data/lib/starter_projects/ec2/.gitignore +1 -0
- data/lib/starter_projects/{yaml_project → ec2}/Gemfile +0 -0
- data/lib/starter_projects/{json_project → ec2}/Guardfile +1 -1
- data/lib/starter_projects/ec2/README.md +86 -0
- data/lib/starter_projects/ec2/app/definitions/base.rb +2 -0
- data/lib/starter_projects/ec2/app/definitions/development.rb +1 -0
- data/lib/starter_projects/ec2/app/definitions/production.rb +1 -0
- data/lib/starter_projects/{yaml_project → ec2/app}/helpers/my_custom_helper.rb +0 -0
- data/lib/starter_projects/{json_project/templates/user_data/app.sh → ec2/app/partials/user_data/bootstrap.sh} +1 -2
- data/lib/starter_projects/{yaml_project → ec2/app}/templates/example.yml +0 -0
- data/lib/starter_projects/{json_project/params/base/api-web.txt → ec2/config/params/base/example.txt} +0 -0
- data/lib/starter_projects/ec2/config/params/development/example.txt +3 -0
- data/lib/starter_projects/ec2/config/params/production/example.txt +2 -0
- data/lib/starter_projects/ec2/config/settings.yml +33 -0
- data/lib/starter_projects/ec2/config/variables/base.rb +3 -0
- data/lib/starter_projects/ec2/config/variables/development.rb +2 -0
- data/lib/starter_projects/ec2/config/variables/production.rb +2 -0
- data/lib/starter_projects/ec2/welcome.txt +8 -0
- data/lib/starter_projects/skeleton/.gitignore +1 -0
- data/lib/starter_projects/skeleton/Gemfile +3 -0
- data/lib/starter_projects/skeleton/Guardfile +12 -0
- data/lib/starter_projects/skeleton/README.md +53 -0
- data/{spec/fixtures/my_project/templates/.gitkeep → lib/starter_projects/skeleton/app/definitions/base.rb} +0 -0
- data/lib/starter_projects/skeleton/config/settings.yml +33 -0
- data/lib/starter_projects/skeleton/welcome.txt +7 -0
- data/lono.gemspec +12 -10
- data/spec/fixtures/lono_project/.gitignore +1 -0
- data/spec/fixtures/lono_project/Gemfile +3 -0
- data/spec/fixtures/lono_project/Guardfile +12 -0
- data/spec/fixtures/lono_project/app/definitions/base.rb +10 -0
- data/spec/fixtures/lono_project/app/definitions/base/more.rb +7 -0
- data/spec/fixtures/lono_project/app/definitions/development.rb +1 -0
- data/spec/fixtures/lono_project/app/definitions/production.rb +1 -0
- data/spec/fixtures/lono_project/app/helpers/custom_helper.rb +5 -0
- data/spec/fixtures/lono_project/app/partials/security_group.yml +10 -0
- data/{lib/starter_projects/yaml_project/templates/partial → spec/fixtures/lono_project/app/partials}/user_data/bootstrap.sh +8 -2
- data/spec/fixtures/lono_project/app/templates/example.yml +50 -0
- data/{lib/starter_projects/yaml_project/params/base/api-web-prod.txt → spec/fixtures/lono_project/config/params/base/example.txt} +1 -0
- data/spec/fixtures/lono_project/config/params/development/example.txt +1 -0
- data/spec/fixtures/lono_project/config/params/production/example.txt +1 -0
- data/spec/fixtures/lono_project/config/settings.yml +31 -0
- data/spec/fixtures/lono_project/config/variables/base.rb +3 -0
- data/spec/fixtures/lono_project/config/variables/development.rb +1 -0
- data/spec/fixtures/lono_project/config/variables/production.rb +1 -0
- data/spec/fixtures/params/envonly/params/{prod → development}/network.txt +0 -0
- data/spec/fixtures/params/overlay/params/{prod → development}/network.txt +0 -0
- data/spec/fixtures/raw_templates/aws-waf-security-automations.template +2 -2
- data/spec/lib/lono/cfn_spec.rb +6 -9
- data/spec/lib/lono/cli_spec.rb +44 -0
- data/spec/lib/lono/completion_spec.rb +17 -0
- data/spec/lib/lono/inspect_spec.rb +6 -15
- data/spec/lib/lono/param/generator_spec.rb +45 -26
- data/spec/lib/lono/param_spec.rb +1 -3
- data/spec/lib/lono/setting_spec.rb +47 -0
- data/spec/lib/lono/template/dsl_spec.rb +33 -157
- data/spec/lib/lono/template_spec.rb +4 -16
- data/spec/spec_helper.rb +45 -14
- metadata +168 -82
- data/.coveralls.yml +0 -1
- data/lib/lono/cfn/help.rb +0 -103
- data/lib/lono/current_region.rb +0 -42
- data/lib/lono/inspector/help.rb +0 -21
- data/lib/lono/settings.rb +0 -45
- data/lib/lono/template/help.rb +0 -25
- data/lib/lono/template/helpers.rb +0 -136
- data/lib/starter_projects/json_project/.gitignore +0 -1
- data/lib/starter_projects/json_project/config/templates/base/blog.rb +0 -20
- data/lib/starter_projects/json_project/config/templates/base/stacks.rb +0 -58
- data/lib/starter_projects/json_project/templates/db.json +0 -212
- data/lib/starter_projects/json_project/templates/partial/host_record.json +0 -28
- data/lib/starter_projects/json_project/templates/partial/server.json +0 -45
- data/lib/starter_projects/json_project/templates/user_data/db.sh +0 -39
- data/lib/starter_projects/json_project/templates/user_data/db2.sh +0 -2
- data/lib/starter_projects/json_project/templates/user_data/ruby_script.rb +0 -5
- data/lib/starter_projects/json_project/templates/web.json +0 -386
- data/lib/starter_projects/yaml_project/.gitignore +0 -1
- data/lib/starter_projects/yaml_project/config/templates/base/blog.rb +0 -20
- data/lib/starter_projects/yaml_project/config/templates/base/stacks.rb +0 -56
- data/lib/starter_projects/yaml_project/config/templates/prod/stacks.rb +0 -1
- data/lib/starter_projects/yaml_project/config/templates/stag/stacks.rb +0 -1
- data/lib/starter_projects/yaml_project/config/variables/base/variables.rb +0 -4
- data/lib/starter_projects/yaml_project/config/variables/prod/variables.rb +0 -1
- data/lib/starter_projects/yaml_project/config/variables/stag/variables.rb +0 -1
- data/lib/starter_projects/yaml_project/params/base/example.txt +0 -2
- data/lib/starter_projects/yaml_project/params/prod/example.txt +0 -1
- data/lib/starter_projects/yaml_project/params/stag/example.txt +0 -1
- data/lib/starter_projects/yaml_project/templates/db.yml +0 -148
- data/lib/starter_projects/yaml_project/templates/partial/host_record.yml +0 -14
- data/lib/starter_projects/yaml_project/templates/partial/server.yml +0 -59
- data/lib/starter_projects/yaml_project/templates/web.yml +0 -206
- data/spec/fixtures/my_project/config/templates/base/stacks.rb +0 -3
- data/spec/fixtures/my_project/params/my-stack.txt +0 -3
- data/spec/fixtures/my_project/templates/my-stack.yml +0 -0
- data/spec/lib/lono/new_spec.rb +0 -59
- data/spec/lib/lono/template/template_spec.rb +0 -104
- data/spec/lib/lono_spec.rb +0 -27
|
@@ -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
|
|
@@ -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 @@
|
|
|
1
|
+
# resources that only exist in the development environment
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# resources that only exist in the production environment
|
|
File without changes
|
|
@@ -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
|
|
3
|
+
echo ${AWS::StackName} > /tmp/stack_name
|
|
5
4
|
cat /proc/uptime | cut -f1 -d'.' > /tmp/time-to-boot
|
|
File without changes
|
|
File without changes
|
|
@@ -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,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,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/).
|
|
File without changes
|
|
@@ -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.
|
|
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 "
|
|
22
|
-
gem.add_dependency "
|
|
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 "
|
|
30
|
-
gem.add_dependency "
|
|
31
|
-
gem.add_dependency "
|
|
32
|
-
gem.add_dependency "
|
|
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,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
|