Class: Amplify::EncryptedDatabaseInfo

Inherits:
VaultDataBagWrapperBase show all
Defined in:
lib/amplify/encrypted_database_info.rb

Instance Attribute Summary

Attributes inherited from VaultDataBagWrapperBase

#strategy

Class Method Summary collapse

Methods inherited from VaultDataBagWrapperBase

chef_databag_load, load, read_from_parameter_store, read_from_vault, strategy=

Class Method Details

.jdbc_url(db_name, env) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/amplify/encrypted_database_info.rb', line 9

def self.jdbc_url(db_name, env)
  db_info = load(db_name, env)

  db_username = db_info['user']
  db_password = db_info['password']
  db_host = db_info['host']
  db_port = db_info['port']
  db_name = db_info['database']
  db_scheme = db_info['scheme']
  "jdbc:#{db_scheme}://#{db_username}:#{db_password}@#{db_host}:#{db_port}/#{db_name}"
end

.vault_path(db_name, env) ⇒ Object



5
6
7
# File 'lib/amplify/encrypted_database_info.rb', line 5

def self.vault_path(db_name, env)
  "secret/#{env}/dbs/standard/#{db_name}"
end