Skip to content

Commit 8764455

Browse files
committed
Moved output folder creation back down after the inputs have been processed so that it is not created if there are errors with the input. Changed lambda action param to be array of single item. Changed http lambda to use default service name of neptune-db if the environment variable is not set.
1 parent e487e9c commit 8764455

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

src/main.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,6 @@ async function main() {
266266

267267
processArgs();
268268

269-
// Init output folder
270-
mkdirSync(outputFolderPath, { recursive: true });
271269
// Get graphDB schema from file
272270
if (inputGraphDBSchemaFile != '' && inputGraphQLSchema == '' && inputGraphQLSchemaFile == '') {
273271
try {
@@ -433,6 +431,9 @@ async function main() {
433431
// Outputs
434432
// ****************************************************************************
435433

434+
// Init output folder
435+
mkdirSync(outputFolderPath, { recursive: true });
436+
436437
// Output GraphQL schema no directives
437438
if (inputGraphQLSchema != '') {
438439

src/pipelineResources.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ async function createLambdaRole() {
252252
"neptune-db:WriteDataViaQuery"
253253
];
254254
} else {
255-
action = "neptune-graph:*"
255+
action = ["neptune-graph:*"]
256256
}
257257

258258
// Create Neptune query policy

templates/Lambda4AppSyncHTTP/index.mjs

+8-1
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,17 @@ const {
1414

1515

1616
if (process.env.NEPTUNE_IAM_AUTH_ENABLED === 'true') {
17+
let serviceName;
18+
if (process.env.NEPTUNE_TYPE) {
19+
serviceName = process.env.NEPTUNE_TYPE;
20+
} else {
21+
console.log('NEPTUNE_TYPE environment variable is not set - defaulting to neptune-db');
22+
serviceName = 'neptune-db';
23+
}
1724
const interceptor = aws4Interceptor({
1825
options: {
1926
region: AWS_REGION,
20-
service: process.env.NEPTUNE_TYPE,
27+
service: serviceName,
2128
},
2229
credentials: {
2330
accessKeyId: AWS_ACCESS_KEY_ID,

0 commit comments

Comments
 (0)