Skip to content

Commit

Permalink
feat: get appsync data according appsync name
Browse files Browse the repository at this point in the history
  • Loading branch information
s4nt14go committed Sep 19, 2023
1 parent 15115bb commit 1e2cb28
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions createEnv.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,12 @@ tables.map(async t => {
$.verbose = false // Don't log sensitive data

await $`aws appsync list-graphql-apis > appsync.json`
let appsyncId = require('./appsync.json').graphqlApis[0].apiId;
let appsyncUrl = require('./appsync.json').graphqlApis[0].uris.GRAPHQL;
await $`rm appsync.json`
const graphqlApis = require(`./appsync.json`).graphqlApis;
await $`rm appsync.json`;
const appsyncName = 'AppSyncApi';
const appsync = graphqlApis.filter(g => g.name === `${stage}-${project}-${appsyncName}`)[0];
let appsyncId = appsync.apiId;
let appsyncUrl = appsync.uris.GRAPHQL;
await $`echo appsyncUrl=${appsyncUrl} >> ${envFile}`
await $`aws appsync list-api-keys --api-id ${appsyncId} > appsyncKeys.json`
let appsyncKey = require('./appsyncKeys.json').apiKeys[0].id;
Expand Down

0 comments on commit 1e2cb28

Please sign in to comment.