Class: AwsEc2::Script

Inherits:
Object
  • Object
show all
Defined in:
lib/aws_ec2/script/upload.rb,
lib/aws_ec2/script.rb,
lib/aws_ec2/script/compile.rb,
lib/aws_ec2/script/compress.rb

Overview

Class for aws-ec2 compile command

Defined Under Namespace

Classes: Compile, Compress, Upload

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Script

Returns a new instance of Script.



7
8
9
# File 'lib/aws_ec2/script.rb', line 7

def initialize(options={})
  @options = options
end

Instance Method Details

#add_to_user_data!(user_data) ⇒ Object



11
12
13
# File 'lib/aws_ec2/script.rb', line 11

def add_to_user_data!(user_data)
  user_data
end

#auto_terminateObject



19
20
21
22
23
# 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_timeoutObject



15
16
17
# File 'lib/aws_ec2/script.rb', line 15

def auto_terminate_after_timeout
  load_template("auto_terminate_after_timeout.sh")
end

#cloudwatchObject



25
26
27
# File 'lib/aws_ec2/script.rb', line 25

def cloudwatch
  load_template("cloudwatch.sh")
end

#create_amiObject



29
30
31
32
33
34
# 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_scriptsObject



36
37
38
# File 'lib/aws_ec2/script.rb', line 36

def extract_aws_ec2_scripts
  load_template("extract_aws_ec2_scripts.sh")
end