GithubHelp home page GithubHelp logo

quinovas / appsync-athena-resolver Goto Github PK

View Code? Open in Web Editor NEW
14.0 3.0 0.0 38 KB

AWS AppSync resolver that provides GraphQL access to Athena databases

License: Apache License 2.0

Python 100.00%
aws-lambda aws-athena aws-appsync

appsync-athena-resolver's Introduction

appsync-athena-resolver

VERSION 0.4.0 IS A BREAKING CHANGE FROM PREVIOUS VERSIONS. PLEASE PAY PARTICULAR ATTENTION TO THE INFORMATION BELOW.

This is a generic Lambda task function that can execute athena queries. It is intended to be used in AWS AppSync. This function will take the input information, call AWS Athena, and respond to AWS AppSync with the results of the SQL call.

Environment Variables

DATABASE

The AWS Athena Database to query. May be overridden in the query request. Defaults to default

WORKGROUP

The AWS Athena Workgroup to use during queries. May be overridden in the query request. Defaults to primary.

MAX_CONCURRENT_QUERIES

The maximum number of concurrent queries allowed in BatchInvoke requests. Defaults to 5.

AWS Permissions Required

  • AmazonAthenaFullAccess arn:aws:iam::aws:policy/AmazonAthenaFullAccess

You will also require read access to the underlying AWS Athena datasource and access to any KMS keys used.

Handler Method

function.handler

Request Syntax

Request:

{
    "query": "select * from bar",
    "params": {},
    "database": "foo",
    "workgroup": "myworkgroup",
    "singleResult": boolean
}
query: REQUIRED

This is the query string to be executed. It may be parameterized with PyFormat, using the new format {} named placeholders method.

params: OPTIONAL

Required if your query is parameterized. The keys in this map should correspond to the format names in your operation string or array.

database: OPTIONAL

The schema/database name that you wish to query. Overrides DATABASE if present.

workgroup: OPTIONAL

The AWS Athena Workgroup to use during. Overrides WORKGROUP if present.

singleResult: OPTIONAL

true if AppSync is expecting a single map result, false if multiple results (maps) in a list may be returned. Defaults to false.

Response:

If singleResult is `true`:

{
  "Key": Value,
  (Keys and values are generated from the query results.
  Keys are the column names, values are converted to their
  specified types.)
}

If singleResult is `false`:

[
  {
    "Key": Value,
    (Keys and values are generated from the query results.
    Keys are the column names, values are converted to their
    specified types.)
  }
]

Lambda Package Location

https://s3.amazonaws.com/lambdalambdalambda-repo/quinovas/appsync-athena-resolver/appsync-athena-resolver-0.4.0.zip

License: APL2

appsync-athena-resolver's People

Contributors

angadis avatar joseph-wortmann avatar vchinnakotla avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

appsync-athena-resolver's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.