Skip to content

Instantly share code, notes, and snippets.

@Atalanta
Created February 14, 2011 19:34
Show Gist options
  • Select an option

  • Save Atalanta/826400 to your computer and use it in GitHub Desktop.

Select an option

Save Atalanta/826400 to your computer and use it in GitHub Desktop.
ree-1.8.7-2010.02 > REGION = "eu-west-1"
=> "eu-west-1"
ree-1.8.7-2010.02 > SIZE = "small"
=> "m1.small"
ree-1.8.7-2010.02 > EBS = nil
=> nil
ree-1.8.7-2010.02 > RELEASE="lucid"
=> "lucid"
ree-1.8.7-2010.02 > def select_ami
ree-1.8.7-2010.02 ?> ami_generator = UbuntuAmi.new(RELEASE)
ree-1.8.7-2010.02 ?> region = ami_generator.region_fix(REGION)
ree-1.8.7-2010.02 ?> size = "_" + SIZE
ree-1.8.7-2010.02 ?> ebs = EBS ? "_ebs" : ""
ree-1.8.7-2010.02 ?> key = region + size + ebs
ree-1.8.7-2010.02 ?> return ami_generator.run[key]
ree-1.8.7-2010.02 ?> end
=> nil
ree-1.8.7-2010.02 > select_ami
=> "ami-a11e2ad5"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment