Class: AMI::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/ami/config.rb

Overview

Defines credentials and account info required to create an AMI

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Config

Returns a new instance of Config.



31
32
33
34
35
36
37
38
39
# File 'lib/ami/config.rb', line 31

def initialize(config)
  @access_key = config.fetch('access_key')
  @secret_key = config.fetch('secret_key')
  @cert_path = config.fetch('cert_path')
  @pk_path = config.fetch('pk_path')
  @account_id = config.fetch('account_id')
  @s3_bucket = config.fetch('s3_bucket')
  @key_name = config.fetch('key_name')
end

Instance Attribute Details

#access_keyObject (readonly)

Your AWS access key



6
7
8
# File 'lib/ami/config.rb', line 6

def access_key
  @access_key
end

#account_idObject (readonly)

Your AWS account ID e.g. 0123-4567-8901



21
22
23
# File 'lib/ami/config.rb', line 21

def 
  @account_id
end

#cert_pathObject (readonly)

The path to your AWS certificate e.g. /my/keys/.ec2/cert-XXXXXXXXXXXXXXXXXXXX.pem



13
14
15
# File 'lib/ami/config.rb', line 13

def cert_path
  @cert_path
end

#key_nameObject (readonly)

The AWS SSH public key to use for this instance. The corresponding private key must be in your keychain



29
30
31
# File 'lib/ami/config.rb', line 29

def key_name
  @key_name
end

#pk_pathObject (readonly)

The path to your corresponding AWS private key file e.g. /my/keys/.ec2/pk-XXXXXXXXXXXXXXXXXXXXXXXX.pem



17
18
19
# File 'lib/ami/config.rb', line 17

def pk_path
  @pk_path
end

#s3_bucketObject (readonly)

The S3 bucket to store created AMIs e.g. my-custom-amis



25
26
27
# File 'lib/ami/config.rb', line 25

def s3_bucket
  @s3_bucket
end

#secret_keyObject (readonly)

Your corresponding AWS secret key



9
10
11
# File 'lib/ami/config.rb', line 9

def secret_key
  @secret_key
end