module Capistrano::Aws::EC2

EC2 module.

Public Class Methods

contact_point(instance) click to toggle source
# File lib/capistrano/aws/ec2/ec2.rb, line 41
def self.contact_point(instance)
  case fetch(:aws_ec2_contact_point)
  when :private_ip
    instance.private_ip_address
  when :private_dns
    instance.private_dns_name
  when :id
    instance.id
  when :public_dns
    instance.public_dns_name
  else
    instance.public_ip_address
  end
end
parse_tag(instance, tag_name) click to toggle source
# File lib/capistrano/aws/ec2/ec2.rb, line 56
def self.parse_tag(instance, tag_name)
  tag = instance.tags.select { |instance_tag| instance_tag.key == tag_name }.first

  if tag.nil?
    ''
  else
    tag.value
  end
end