def credentials(opts)
      calback = lambda do
        credentials = nil
        unless opts[:access_key_id].empty? or opts[:secret_access_key].empty?
          credentials = Aws::Credentials.new opts[:access_key_id], opts[:secret_access_key]
        else
          if opts[:assume_role_arn].nil?
            if opts[:ecs_container_credentials_relative_uri].nil?
              credentials = Aws::SharedCredentials.new({retries: 2}).credentials
              credentials ||= Aws::InstanceProfileCredentials.new.credentials
              credentials ||= Aws::ECSCredentials.new.credentials
            else
              credentials = Aws::ECSCredentials.new({
                credential_path: opts[:ecs_container_credentials_relative_uri]
              }).credentials
            end
          else
            credentials = sts_credential_provider({
                            role_arn: opts[:assume_role_arn],
                            role_session_name: opts[:assume_role_session_name],
                            region: opts[:region]
                          }).credentials
          end
        end
        raise "No valid AWS credentials found." unless credentials.set?
        credentials
      end
      def calback.inspect
        credentials = self.call
        credentials.credentials.inspect
      end
      calback
    end
def credentials(opts)
      calback = lambda do
        credentials = nil
        unless opts[:access_key_id].empty? or opts[:secret_access_key].empty?
          credentials = Aws::Credentials.new opts[:access_key_id], opts[:secret_access_key]
        else
          if opts[:assume_role_arn].nil?
            if opts[:ecs_container_credentials_relative_uri].nil?
              credentials = Aws::SharedCredentials.new({retries: 2}).credentials
              credentials ||= Aws::InstanceProfileCredentials.new.credentials
              credentials ||= Aws::ECSCredentials.new.credentials
            else
              credentials = Aws::ECSCredentials.new({
                credential_path: opts[:ecs_container_credentials_relative_uri]
              }).credentials
            end
          else
            credentials = sts_credential_provider({
                            role_arn: opts[:assume_role_arn],
                            role_session_name: opts[:assume_role_session_name],
                            region: opts[:region]
                          }).credentials
          end
        end
        raise "No valid AWS credentials found." unless credentials.set?
        credentials
      end
      def calback.inspect
        credentials = self.call
        credentials.credentials.inspect
      end
      calback
    end
get AWS Credentials