class AwsEc2::Script
Class for aws-ec2 compile command
Class for aws-ec2 upload command
Public Class Methods
new(options={})
click to toggle source
# File lib/aws_ec2/script.rb, line 7 def initialize(options={}) @options = options end
Public Instance Methods
add_to_user_data!(user_data)
click to toggle source
# File lib/aws_ec2/script.rb, line 11 def add_to_user_data!(user_data) user_data end
auto_terminate()
click to toggle source
# File lib/aws_ec2/script.rb, line 19 def auto_terminate # set variables for the template @ami_name = @options[:ami_name] load_template("auto_terminate.sh") end
auto_terminate_after_timeout()
click to toggle source
# File lib/aws_ec2/script.rb, line 15 def auto_terminate_after_timeout load_template("auto_terminate_after_timeout.sh") end
cloudwatch()
click to toggle source
# File lib/aws_ec2/script.rb, line 25 def cloudwatch load_template("cloudwatch.sh") end
create_ami()
click to toggle source
# File lib/aws_ec2/script.rb, line 29 def create_ami # set variables for the template @ami_name = @options[:ami_name] @region = `aws configure get region`.strip rescue 'us-east-1' load_template("ami_creation.sh") end
extract_aws_ec2_scripts()
click to toggle source
# File lib/aws_ec2/script.rb, line 36 def extract_aws_ec2_scripts load_template("extract_aws_ec2_scripts.sh") end
Private Instance Methods
load_template(name)
click to toggle source
# File lib/aws_ec2/script.rb, line 41 def load_template(name) template = IO.read(File.expand_path("script/templates/#{name}", File.dirname(__FILE__))) text = ERB.new(template, nil, "-").result(binding) end