Class: Cyoi::Cli::Image::ImageCliAws

Inherits:
ImageCliBase show all
Defined in:
lib/cyoi/cli/provider_image/image_cli_aws.rb

Instance Attribute Summary

Attributes inherited from ImageCliBase

#attributes, #hl, #provider_client

Instance Method Summary collapse

Methods inherited from ImageCliBase

#display_confirmation, #export_attributes, #initialize, #perform_and_return_attributes, #valid?

Constructor Details

This class inherits a constructor from Cyoi::Cli::Image::ImageCliBase

Instance Method Details

#image_idObject



4
5
6
# File 'lib/cyoi/cli/provider_image/image_cli_aws.rb', line 4

def image_id
  trusty_image_id
end

#trusty_image_id(region = nil) ⇒ Object

Ubuntu 14.04



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/cyoi/cli/provider_image/image_cli_aws.rb', line 9

def trusty_image_id(region=nil)
  region = provider_client.attributes.region
  # http://cloud-images.ubuntu.com/locator/ec2/
  # version: 14.04 LTS
  # arch: amd64
  # instance type: ebs-ssd (not hvm)
  # Using release 20140927
  image_id = case region.to_s
  when "ap-northeast-1"
    "ami-df4b60de"
  when "ap-southeast-1"
    "ami-2ce7c07e"
  when "eu-west-1"
    "ami-f6b11181"
  when "sa-east-1"
    "ami-71d2676c"
  when "us-east-1"
    "ami-98aa1cf0"
  when "us-west-1"
    "ami-736e6536"
  when "cn-north-1"
    "ami-e642d0df"
  when "ap-southeast-2"
    "ami-1f117325"
  when "us-west-2"
    "ami-37501207"
  end
  image_id || raise("Please add Ubuntu 14.04 64bit (EBS SSD) AMI image id to aws.rb#trusty_image_id method for region '#{region}'")
end