Sha256: d6cd241eda551bf0ecce8d3a3e8c6ca957907f978b319ccf5fe49a187af4ecc5

Contents?: true

Size: 753 Bytes

Versions: 1

Compression:

Stored size: 753 Bytes

Contents

# frozen_string_literal: true

require_relative "/lib/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.9 lib/services/aws_services.rb