Class: Lyra::Client
Instance Method Summary collapse
- #fetch_secret(secret_name: String) ⇒ Object
-
#initialize(config: Lyra::ClientConfig) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(config: Lyra::ClientConfig) ⇒ Client
Returns a new instance of Client.
6 7 8 9 10 |
# File 'lib/lyra/client.rb', line 6 def initialize(config: Lyra::ClientConfig) @config = config credentials = Aws::Credentials.new(@config.access_key_id, @config.secret_access_key) @client = Aws::SecretsManager::Client.new(credentials: credentials, region: @config.aws_region) end |
Instance Method Details
#fetch_secret(secret_name: String) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/lyra/client.rb', line 12 def fetch_secret(secret_name: String) response = @client.get_secret_value({ secret_id: make_secret_name(from: secret_name) }) response.secret_string end |