@@ -33,6 +33,7 @@ class PluginStack extends cdk.Stack {
3333
3434 const adminTopicName = resourceConfig [ "topic_name" ] ;
3535 const adminBucketName = resourceConfig [ "bucket_name" ] ;
36+ const exampleBucketName = resourceConfig [ "s3_bucket_name_prefix" ] ;
3637 this . awsRegion = resourceConfig [ "aws_region" ] ;
3738 this . adminAccountId = resourceConfig [ "admin_acct" ] ;
3839 const snsTopic = this . initGetTopic ( adminTopicName ) ;
@@ -42,7 +43,7 @@ class PluginStack extends cdk.Stack {
4243 this . batchMemory = acctConfig [ `${ toolName } ` ] ?. memory ?? "16384" ;
4344 this . batchVcpus = acctConfig [ `${ toolName } ` ] ?. vcpus ?? "4" ;
4445 }
45- const [ jobDefinition , jobQueue ] = this . initBatchFargate ( ) ;
46+ const [ jobDefinition , jobQueue ] = this . initBatchFargate ( exampleBucketName ) ;
4647 const batchFunction = this . initBatchLambda ( jobQueue , jobDefinition ) ;
4748 this . initSqsLambdaIntegration ( batchFunction , sqsQueue ) ;
4849 if ( acctConfig [ `${ toolName } ` ] . status === "enabled" ) {
@@ -59,7 +60,7 @@ class PluginStack extends cdk.Stack {
5960 ) ;
6061 }
6162
62- private initBatchFargate ( ) : [ batch . CfnJobDefinition , batch . CfnJobQueue ] {
63+ private initBatchFargate ( exampleBucketName : string ) : [ batch . CfnJobDefinition , batch . CfnJobQueue ] {
6364 const batchExecutionRole = new iam . Role (
6465 this ,
6566 `BatchExecutionRole-${ toolName } ` ,
@@ -134,6 +135,12 @@ class PluginStack extends cdk.Stack {
134135 value : this . batchMemory ,
135136 } ,
136137 ] ,
138+ environment : [
139+ {
140+ name : "S3_BUCKET_NAME_PREFIX" ,
141+ value : exampleBucketName
142+ } ,
143+ ] ,
137144 } ,
138145 platformCapabilities : [ "FARGATE" ] ,
139146 } ) ;
@@ -159,7 +166,7 @@ class PluginStack extends cdk.Stack {
159166
160167 private initBatchLambda (
161168 jobQueue : batch . CfnJobQueue ,
162- jobDefinition : batch . CfnJobDefinition ,
169+ jobDefinition : batch . CfnJobDefinition
163170 ) : lambda . Function {
164171 const executionRole = new iam . Role (
165172 this ,
@@ -188,7 +195,7 @@ class PluginStack extends cdk.Stack {
188195 environment : {
189196 JOB_QUEUE : jobQueue . ref ,
190197 JOB_DEFINITION : jobDefinition . ref ,
191- JOB_NAME : `job-${ toolName } ` ,
198+ JOB_NAME : `job-${ toolName } `
192199 } ,
193200 role : executionRole ,
194201 } ) ;
0 commit comments