Sha256: 0833b072f2ce5f191edda2df3bfdd92b1f8657a1b83e089cb8d0f3167bfd87f2

Contents?: true

Size: 751 Bytes

Versions: 1

Compression:

Stored size: 751 Bytes

Contents

# frozen_string_literal: true

require_relative "../qas_dock_gem/version"

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}")
            JSON.parse(secret.secret_string)
        end
    end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
qas_dock_gem-0.1.7 lib/services/aws_services.rb