Skip to content

Commit

Permalink
update cdk
Browse files Browse the repository at this point in the history
  • Loading branch information
russbiggs committed Apr 13, 2023
1 parent 7fc3628 commit 6c09adb
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions cdk/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import * as cdk from 'aws-cdk-lib';
import { readFileSync } from 'fs';
import { RealtimeFetcherStack } from './stack';

const DOTENV = process.env.DOTENV || '.env';
///const DOTENV = process.env.DOTENV || '.env';

const envs = readFileSync(`../src/${DOTENV}`, 'utf8');
//const envs = readFileSync(`../src/${DOTENV}`, 'utf8');

interface keyable {
[key: string]: string
Expand All @@ -16,20 +16,20 @@ const env: keyable = {

const reserved_keys = ['AWS_ACCESS_KEY_ID', 'AWS_SECRET_ACCESS_KEY'];

envs.split('\n').forEach(function (e) {
if (e) {
let idx = e.indexOf('=');
let name = e.substring(0,idx);
let value = e.substring(idx + 1, e.length);
if (!env[name] && !reserved_keys.includes(name)) {
env[name] = value;
}
}
});
// envs.split('\n').forEach(function (e) {
// if (e) {
// let idx = e.indexOf('=');
// let name = e.substring(0,idx);
// let value = e.substring(idx + 1, e.length);
// if (!env[name] && !reserved_keys.includes(name)) {
// env[name] = value;
// }
// }
// });

const app = new cdk.App();

const stack = new RealtimeFetcherStack(app, `fetcher-${env.ID}`, {
const stack = new RealtimeFetcherStack(app, `fetcher-openaq`, {
env,
});

Expand Down

0 comments on commit 6c09adb

Please sign in to comment.