Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ const athenaExpressConfig = {
getStats: BOOLEAN, /* optional default=false */
ignoreEmpty: BOOLEAN, /* optional default=true */
encryption: OBJECT /* optional */
skipResults: BOOLEAN /* optional default=false */
skipResults: BOOLEAN /* optional default=false */
region: "STRING_VALUE", /* optional default=aws.config.region */
};

//Initializing AthenaExpress
Expand All @@ -146,6 +147,7 @@ const athenaExpress = new AthenaExpress(athenaExpressConfig);
|ignoreEmpty | boolean | `true`| Ignore fields with empty values from the final JSON response. |
|encryption | object | -- | [Encryption configuation](https://docs.aws.amazon.com/athena/latest/ug/encryption.html) example usage: <br />`{ EncryptionOption: "SSE_KMS", KmsKey: process.env.kmskey}` |
|skipResults | boolean | `false` | For a unique requirement where a user may only want to execute the query in Athena and store the results in S3 but NOT fetch those results in that moment. <br />Perhaps to be retrieved later or simply stored in S3 for auditing/logging purposes. <br />Best used with a combination of `getStats : true` so that the `QueryExecutionId` & `S3Location` can be captured for later reference. |
| region | string | `aws.config.region` | AWS region for S3 and Athena |

## Usage: Invoking athena-express

Expand Down
6 changes: 3 additions & 3 deletions lib/athenaExpress.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ module.exports = class AthenaExpress {
constructor(init) {
validateConstructor(init);
this.config = {
athena: new init.aws.Athena({ apiVersion: "2017-05-18" }),
s3: new init.aws.S3({ apiVersion: "2006-03-01" }),
athena: new init.aws.Athena({ apiVersion: "2017-05-18", region: init.region, }),
s3: new init.aws.S3({ apiVersion: "2006-03-01", region: init.region, }),
s3Bucket:
init.s3 ||
`s3://athena-express-${init.aws.config.credentials.accessKeyId
Expand Down Expand Up @@ -230,7 +230,7 @@ function validateConstructor(init) {

try {
let aws = init.s3 ? init.s3 : init.aws.config.credentials.accessKeyId;
let athena = new init.aws.Athena({ apiVersion: "2017-05-18" });
let athena = new init.aws.Athena({ apiVersion: "2017-05-18", region: init.region, });
} catch (e) {
throw new TypeError(
"AWS object not present or incorrect in the constructor"
Expand Down