Method: AmiSpec::ServerSpec#initialize

Defined in:
lib/ami_spec/server_spec.rb

#initialize(options) ⇒ ServerSpec

Returns a new instance of ServerSpec.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/ami_spec/server_spec.rb', line 8

def initialize(options)
  instance = options.fetch(:instance)
  public_ip = options.fetch(:aws_public_ip)

  @debug = options.fetch(:debug)
  @ip = public_ip ? instance.public_ip_address : instance.private_ip_address
  @role = instance.tags.find{ |tag| tag.key == 'AmiSpec' }.value
  @spec = options.fetch(:specs)
  @user = options.fetch(:ssh_user)
  @key_file = options.fetch(:key_file)
  @buildkite = options.fetch(:buildkite)
  @user_data_file = options.fetch(:user_data_file)
  @iam_instance_profile_arn = options.fetch(:user_data_file)
end