Class: AwsEc2Environment::Config

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(env_name, attrs) ⇒ Config

Returns a new instance of Config.

Parameters:

  • env_name (Symbol)
  • attrs (Hash)


20
21
22
23
24
25
26
27
28
29
# File 'lib/aws_ec2_environment/config.rb', line 20

def initialize(env_name, attrs)
  @env_name = env_name
  @aws_region = attrs.fetch("aws_region")
  @use_ssm = attrs.fetch("use_ssm", false)
  @ssm_host = attrs.fetch("ssm_host", "127.0.0.1")
  @ssh_user = attrs.fetch("ssh_user")
  @instance_filters = attrs.fetch("filters")

  @bastion_filters, @bastion_ssh_user = fetch_bastion_details(attrs)
end

Instance Attribute Details

#aws_regionObject (readonly)

Returns the value of attribute aws_region.



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

def aws_region
  @aws_region
end

#bastion_filtersObject (readonly)

Returns the value of attribute bastion_filters.



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

def bastion_filters
  @bastion_filters
end

#bastion_ssh_userObject (readonly)

Returns the value of attribute bastion_ssh_user.



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

def bastion_ssh_user
  @bastion_ssh_user
end

#env_nameObject (readonly)

Returns the value of attribute env_name.



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

def env_name
  @env_name
end

#instance_filtersObject (readonly)

Returns the value of attribute instance_filters.



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

def instance_filters
  @instance_filters
end

#ssh_userObject (readonly)

Returns the value of attribute ssh_user.



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

def ssh_user
  @ssh_user
end

#ssm_hostObject (readonly)

Returns the value of attribute ssm_host.



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

def ssm_host
  @ssm_host
end

#use_ssmObject (readonly)

Returns the value of attribute use_ssm.



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

def use_ssm
  @use_ssm
end