lono 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -0
- data/lib/lono/template.rb +2 -2
- data/lib/lono/version.rb +1 -1
- data/lib/starter_project/templates/user_data/db.sh.erb +2 -2
- metadata +1 -1
data/README.md
CHANGED
@@ -79,6 +79,8 @@ Within a user_data script you can call another helper method called ref.
|
|
79
79
|
|
80
80
|
* ref - can be use to reference other parameter or resource value within the cloud formation template. An [example](lib/starter_project/templates/user_data/db.sh.erb) is in the [starter_project](lib/starter_project).
|
81
81
|
|
82
|
+
* find_in_map - can be use to call the find_in_map function within the cloud formation template. An [example](lib/starter_project/templates/user_data/db.sh.erb) is in the [starter_project](lib/starter_project).
|
83
|
+
|
82
84
|
## Breaking up config/lono.rb
|
83
85
|
|
84
86
|
If you have a lot of templates, the config/lono.rb file can get unwieldy long. You can break up the lono.rb file and put template defintions in the config/lono directory. Any file in this directory will be automatically loaded. An [example](lib/starter_project/config/lono/api.rb) is in the starter project.
|
data/lib/lono/template.rb
CHANGED
@@ -50,8 +50,8 @@ module Lono
|
|
50
50
|
%Q|{"Ref"=>"#{name}"}|
|
51
51
|
end
|
52
52
|
|
53
|
-
# http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-
|
54
|
-
def
|
53
|
+
# http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-findinmap.html
|
54
|
+
def find_in_map(*args)
|
55
55
|
args.map! {|x| x =~ /=>/ ? x : x.inspect }
|
56
56
|
%Q|{"Fn::FindInMap" => [ #{args.join(',')} ]}|
|
57
57
|
end
|
data/lib/lono/version.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
#!/bin/bash -lexv
|
2
2
|
exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1
|
3
3
|
|
4
|
-
FINDINMAP_TEST=<%=
|
5
|
-
HOSTNAME_PREFIX=<%=
|
4
|
+
FINDINMAP_TEST=<%= find_in_map("MapName", "TopLevelKey", "SecondLevelKey") %>
|
5
|
+
HOSTNAME_PREFIX=<%= find_in_map("EnvironmentMapping", "HostnamePrefix", ref("Environment")) %>
|
6
6
|
|
7
7
|
echo <%= ref("AWS::StackName") %> > /tmp/stack_name
|
8
8
|
# Helper function
|