27 lines
903 B
Ruby
27 lines
903 B
Ruby
require_relative "accounts_factory"
|
|
module Provider
|
|
class Ec2AccountsFactory < AccountsFactory
|
|
|
|
def init config
|
|
@connections = {}
|
|
Devops::Db.connector.provider_accounts(Ec2::PROVIDER).each do |account|
|
|
options = {
|
|
aws_certificate: account.certificate,
|
|
aws_ssh_key: account.ssh_key,
|
|
aws_access_key_id: account.access_key_id,
|
|
aws_secret_access_key: account.secret_access_key,
|
|
aws_availability_zone: account.availability_zone,
|
|
|
|
aws_proxy: config[:aws_proxy],
|
|
aws_no_proxy: config[:aws_no_proxy],
|
|
aws_integration_run_list: config[:aws_integration_run_list]
|
|
}
|
|
@connections[account.account_name] = Ec2.new(options)
|
|
#DevopsLogger.logger.info("Found ec2 account '#{account.account_name}'")
|
|
puts "\tFound ec2 account '#{account.account_name}'"
|
|
end
|
|
end
|
|
|
|
end
|
|
end
|