Skip to content

Commit 28abf07

Browse files
ford-at-awsDavidSouther
authored andcommitted
nit for corey
1 parent 9bd141c commit 28abf07

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

.tools/test/stacks/plugin/typescript/plugin_stack.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ import * as subs from "aws-cdk-lib/aws-sns-subscriptions";
1515
import { Construct } from "constructs";
1616
import { readAccountConfig } from "../../config/targets";
1717
import { readResourceConfig } from "../../config/resources";
18-
import * as fs from 'fs';
19-
18+
import variableConfigJson from "../../config/variables.json";
2019

2120
const toolName = process.env.TOOL_NAME ?? "defaultToolName";
2221

@@ -29,8 +28,6 @@ class PluginStack extends cdk.Stack {
2928
constructor(scope: Construct, id: string, props?: cdk.StackProps) {
3029
super(scope, id, props);
3130

32-
const variableConfigJson = JSON.parse(fs.readFileSync('../../config/variables.json', 'utf-8'));
33-
3431
const acctConfig = readAccountConfig("../../config/targets.yaml");
3532
const resourceConfig = readResourceConfig("../../config/resources.yaml");
3633

@@ -47,7 +44,7 @@ class PluginStack extends cdk.Stack {
4744
this.batchVcpus = acctConfig[`${toolName}`]?.vcpus ?? "4";
4845
}
4946

50-
const [jobDefinition, jobQueue] = this.initBatchFargate(variableConfigJson);
47+
const [jobDefinition, jobQueue] = this.initBatchFargate();
5148
const batchFunction = this.initBatchLambda(jobQueue, jobDefinition);
5249
this.initSqsLambdaIntegration(batchFunction, sqsQueue);
5350

@@ -65,7 +62,7 @@ class PluginStack extends cdk.Stack {
6562
);
6663
}
6764

68-
private initBatchFargate(variables: Array<string, string>): [batch.CfnJobDefinition, batch.CfnJobQueue] {
65+
private initBatchFargate(): [batch.CfnJobDefinition, batch.CfnJobQueue] {
6966
const batchExecutionRole = new iam.Role(
7067
this,
7168
`BatchExecutionRole-${toolName}`,
@@ -121,11 +118,6 @@ class PluginStack extends cdk.Stack {
121118

122119
const containerImageUri = `${this.adminAccountId}.dkr.ecr.us-east-1.amazonaws.com/${toolName}:latest`;
123120

124-
const environmentVariables = Object.entries(variables).map(([key, value]) => ({
125-
name: key,
126-
value: String(value), // Ensure value is a string
127-
}));
128-
129121
const jobDefinition = new batch.CfnJobDefinition(this, "JobDefn", {
130122
type: "container",
131123
containerProperties: {
@@ -145,7 +137,7 @@ class PluginStack extends cdk.Stack {
145137
value: this.batchMemory,
146138
},
147139
],
148-
environment: environmentVariables,
140+
environment: variableConfigJson,
149141
},
150142
platformCapabilities: ["FARGATE"],
151143
});

.tools/test/stacks/plugin/typescript/tsconfig.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
"inlineSources": true,
1919
"experimentalDecorators": true,
2020
"strictPropertyInitialization": false,
21-
"typeRoots": ["./node_modules/@types"]
21+
"typeRoots": ["./node_modules/@types"],
22+
"resolveJsonModule": true,
23+
"esModuleInterop": true
2224
},
2325
"exclude": ["node_modules", "cdk.out"]
2426
}

0 commit comments

Comments
 (0)