Sha256: f3c3ceb5183d5431671b88d9ac13a421f22e4ffbc66f25ef3fa288fcbf977e94

Contents?: true

Size: 748 Bytes

Versions: 2

Compression:

Stored size: 748 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

2 entries across 2 versions & 1 rubygems

Version Path
qas_dock_gem-0.1.11 lib/aws_services.rb
qas_dock_gem-0.1.10 lib/aws_services.rb