Module: Rubber::Tag

Defined in:
lib/rubber/tag.rb

Class Method Summary collapse

Class Method Details

.update_instance_tags(instance_alias) ⇒ Object

Updates the tags for the given ec2 instance



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/rubber/tag.rb', line 4

def self.update_instance_tags(instance_alias)
  instance_item = Rubber::Configuration.rubber_instances[instance_alias]
  fatal "Instance does not exist: #{instance_alias}" if ! instance_item

  rubber_cfg = Rubber::Configuration.get_configuration(RUBBER_ENV)
  rubber_env = rubber_cfg.environment.bind()

  cloud = Rubber::Cloud::get_provider(rubber_env.cloud_provider || "aws", Rubber::Configuration.rubber_env, self)

  cloud.create_tags(instance_item.instance_id, :Name => instance_alias, :Environment => RUBBER_ENV)
end