in packages/cdk/lib/stacks/engines/nextflow-engine-construct.ts [31:76]
constructor(scope: Construct, id: string, props: NextflowEngineConstructProps) {
super(scope, id);
const params = props.contextParameters;
const outputBucket = Bucket.fromBucketName(this, "OutputBucket", params.outputBucketName);
const artifactBucket = Bucket.fromBucketName(this, "ArtifactBucket", params.artifactBucketName);
const engineRole = new NextflowEngineRole(this, "NextflowEngineRole", {
batchJobPolicyArns: [props.jobQueue.jobQueueArn],
readOnlyBucketArns: (params.readBucketArns ?? []).concat(artifactBucket.bucketArn),
readWriteBucketArns: (params.readWriteBucketArns ?? []).concat(outputBucket.bucketArn),
policies: props.policyOptions,
});
this.nextflowEngine = new NextflowEngine(this, "NextflowEngine", {
vpc: props.vpc,
jobQueueArn: props.jobQueue.jobQueueArn,
rootDirS3Uri: params.getEngineBucketPath(),
taskRole: engineRole,
});
const adapterRole = new NextflowAdapterRole(this, "NextflowAdapterRole", {
batchJobPolicyArns: [this.nextflowEngine.headJobDefinition.jobDefinitionArn, props.headQueue.jobQueueArn],
readOnlyBucketArns: [],
readWriteBucketArns: [outputBucket.bucketArn],
});
const engineLogGroup = this.nextflowEngine.logGroup;
engineLogGroup.grant(engineRole, "logs:StartQuery");
engineLogGroup.grant(adapterRole, "logs:StartQuery");
const lambda = this.renderAdapterLambda({
vpc: props.vpc,
role: adapterRole,
jobQueueArn: props.headQueue.jobQueueArn,
jobDefinitionArn: this.nextflowEngine.headJobDefinition.jobDefinitionArn,
engineLogGroupName: engineLogGroup.logGroupName,
});
this.adapterLogGroup = lambda.logGroup;
this.apiProxy = new ApiProxy(this, {
apiName: `${params.projectName}${params.userId}${params.contextName}NextflowApiProxy`,
lambda,
allowedAccountIds: [Aws.ACCOUNT_ID],
});
}