Sha256: e8f793b97297c8e42ad803db864ef55d46c3f3d21145078cfe5b10748558dacd

Contents?: true

Size: 643 Bytes

Versions: 6

Compression:

Stored size: 643 Bytes

Contents

# frozen_string_literal: true

module QasDockGem
  class AwsServices
    def credentials_aws(access_key_id, secret_access_key_id, region)
      {
        access_key_id: access_key_id,
        secret_access_key: secret_access_key_id,
        region: region
      }
    end

    def init_secrets_manager(credentials)
      require 'aws-sdk-secretsmanager'
      Aws::SecretsManager::Client.new(credentials)
    end

    def get_sm_secret_value(credentials, secret_name)
      secret = init_secrets_manager(credentials).get_secret_value(secret_id: secret_name.to_s)
      JSON.parse(secret.secret_string)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
qas_dock_gem-0.1.41 lib/qas_dock_gem/services/aws_services.rb
qas_dock_gem-0.1.40 lib/qas_dock_gem/services/aws_services.rb
qas_dock_gem-0.1.39 lib/qas_dock_gem/services/aws_services.rb
qas_dock_gem-0.1.38 lib/qas_dock_gem/services/aws_services.rb
qas_dock_gem-0.1.37 lib/qas_dock_gem/services/aws_services.rb
qas_dock_gem-0.1.36 lib/qas_dock_gem/services/aws_services.rb