Skip to content

Commit 9f371e6

Browse files
Add lambda layer for template files
Add layer that contains the templating files used for generating the document in the lambda. Ticket: AT-7345
1 parent d5888ba commit 9f371e6

File tree

3 files changed

+256
-0
lines changed

3 files changed

+256
-0
lines changed
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
html {
2+
font-size: 10px;
3+
font-family: 'Times New Roman', Times, serif;
4+
}
5+
6+
body {
7+
font-size: 1.6rem;
8+
}
9+
10+
.main-wrap {
11+
padding: 100px 120px;
12+
margin: 0 auto;
13+
max-width: 768px;
14+
}
15+
16+
p {
17+
margin: 0 0 1.6rem;
18+
line-height: 2.1rem;
19+
}
20+
21+
.text-right {
22+
text-align: right;
23+
}
24+
25+
.align-center {
26+
margin: 0 auto;
27+
}
28+
29+
h1 {
30+
font-size: 1.9rem;
31+
text-transform: uppercase;
32+
margin-bottom: 2.4rem !important;
33+
text-align: center;
34+
margin-top: 0;
35+
}
36+
37+
table {
38+
border-collapse: collapse;
39+
}
40+
41+
td, th {
42+
border: 1px solid black;
43+
padding: 8px 16px;
44+
line-height: 2.2rem;
45+
}
46+
47+
.award-mod-table {
48+
width: 380px;
49+
margin: 0 auto 2.4rem;
50+
}
51+
52+
.award-mod-table td, .award-mod-table th {
53+
width: 190px;
54+
}
55+
56+
.contract-details-table {
57+
width: 100%;
58+
margin-bottom: 12px;
59+
}
60+
61+
.contract-details-table th {
62+
text-align: left;
63+
font-weight: normal;
64+
width: 300px;
65+
}
66+
67+
hr {
68+
margin: 0 0 12px 0;
69+
border: none;
70+
height: 1px;
71+
background-color: #e0e1e2;
72+
}
73+
74+
section {
75+
padding: 12px 0;
76+
}
77+
78+
.d-flex {
79+
display: flex;
80+
}
81+
82+
.number {
83+
font-weight: bold;
84+
flex: 0 38px;
85+
}
86+
87+
.content {
88+
flex: 1;
89+
}
90+
91+
.content > p {
92+
margin-top: -2px;
93+
}
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
7+
<title>ATAT Description of Work</title>
8+
<!-- <link rel="stylesheet" href="style.css"> -->
9+
<style type="text/css"></style>
10+
<!-- <script src="https://cdn.jsdelivr.net/npm/handlebars@latest/dist/handlebars.js"></script> -->
11+
<!-- <script src="index.js"></script> -->
12+
</head>
13+
<body>
14+
<!-- <script id="DoW_Template" type="text/x-handlebars-template"> -->
15+
<div class="main-wrap">
16+
17+
<h1>Description of Work</h1>
18+
<table class="award-mod-table">
19+
<thead>
20+
<tr>
21+
<th>Award/Mod Effective</th>
22+
<th>Version Date</th>
23+
</tr>
24+
</thead>
25+
<tbody>
26+
{{#each award_history}}
27+
<tr>
28+
<td>{{this.contract_award_type}}</td>
29+
<td class="text-right">{{this.effective_date}}</td>
30+
</tr>
31+
{{/each}}
32+
<tr>
33+
<td>Award</td>
34+
<td class="text-right">TBD</td>
35+
</tr>
36+
<tr>
37+
<td>&nbsp;</td>
38+
<td>&nbsp;</td>
39+
</tr>
40+
<tr>
41+
<td>&nbsp;</td>
42+
<td></td>
43+
</tr>
44+
<tr>
45+
<td>&nbsp;</td>
46+
<td></td>
47+
</tr>
48+
</tbody>
49+
</table>
50+
51+
<table class="contract-details-table">
52+
<tr>
53+
<th>Contract Number:</th>
54+
<td>TBD</td>
55+
</tr>
56+
<tr>
57+
<th>Task Order (TO) Number:</th>
58+
<td>TBD</td>
59+
</tr>
60+
<tr>
61+
<th>Contractor Name:</th>
62+
<td>TBD</td>
63+
</tr>
64+
<tr>
65+
<th>Tracking Number:</th>
66+
<td>TBD</td>
67+
</tr>
68+
<tr>
69+
<th>Follow-on to Previous Contract and Task Order Number:</th>
70+
<td>
71+
Contract Number: {{contract_information.contract_number}} <br />
72+
Task Order Number: {{contract_information.previous_task_order_number}}</td>
73+
</tr>
74+
</table>
75+
76+
<section class="d-flex">
77+
<div class="number">1.</div>
78+
<div class="content"><u>TO Title.</u> {{to_title}}</div>
79+
</section>
80+
81+
<section class="d-flex">
82+
<div class="number">2.</div>
83+
<div class="content">
84+
<p>
85+
<u>Scope.</u><br />
86+
{{scope}}
87+
</p>
88+
<p style="margin-bottom: 0;">
89+
The Government may require surge capabilities during the base or any option period,
90+
and surge modifications will be within the scope of the contract for the defined task
91+
areas of this description of work. Surge capabilities over the life of the task order
92+
will not exceed {{scope_surge}}% of the contractor’s total proposed price for the
93+
base and all option periods, excluding any six-month extension of services pursuant
94+
to Federal Acquisition Regulation (FAR) <span style="white-space: nowrap;">52.217-8.</span>
95+
</p>
96+
97+
</div>
98+
</section>
99+
100+
<section class="d-flex">
101+
<div class="number">4.</div>
102+
<div class="content">
103+
<u>Performance Requirements.</u>
104+
</div>
105+
</section>
106+
107+
<section class="d-flex">
108+
<div class="number">4.2</div>
109+
<div class="content">
110+
<u>Task 2 &mdash; XaaS</u>
111+
</div>
112+
</section>
113+
114+
<section class="d-flex">
115+
<div class="number">4.2.2</div>
116+
<div class="content">
117+
<p>
118+
<u>Subtask 2 Developer Tools and Services</u>
119+
</p>
120+
121+
{{#each toolsAndServices}}
122+
<p>
123+
<strong>4.2.2.{{inc @index}}</strong> <u>{{classification}} &mdash; {{toolOrService}}</u><br />
124+
Duration: {{duration}}
125+
</p>
126+
<p>
127+
{{description}}
128+
</p>
129+
{{/each}}
130+
131+
</div>
132+
</section>
133+
134+
<hr />
135+
136+
<section class="d-flex">
137+
<div class="number">11.</div>
138+
<div class="content">
139+
<p>
140+
<u>Section 508 Accessibility Standards for Cloud Computing.</u>
141+
</p>
142+
{{{section508Content}}}
143+
</div>
144+
</section>
145+
</div>
146+
147+
<!-- </script> -->
148+
</body>
149+
</html>

lib/atat-web-api-stack.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as cdk from "aws-cdk-lib";
22
import * as apigw from "aws-cdk-lib/aws-apigateway";
33
import * as iam from "aws-cdk-lib/aws-iam";
44
import * as statement from "cdk-iam-floyd";
5+
import * as lambda from "aws-cdk-lib/aws-lambda";
56
import * as nodejs from "aws-cdk-lib/aws-lambda-nodejs";
67
import { Construct } from "constructs";
78
import { AtatNetStack } from "./atat-net-stack";
@@ -99,10 +100,23 @@ export class AtatWebApiStack extends cdk.Stack {
99100
provisioningSfn.provisioningQueueConsumer.method,
100101
new apigw.LambdaIntegration(provisioningSfn.provisioningQueueConsumer.fn)
101102
);
103+
102104
// APIGW Document Generation Resource
103105
const generateDocumentResource = api.restApi.root.addResource("generate-document");
106+
const documentGenerationLayer = new lambda.LayerVersion(this, "GenerateDocumentSupportLayer", {
107+
compatibleRuntimes: [lambda.Runtime.NODEJS_16_X],
108+
code: lambda.Code.fromAsset("document-generation/templates", {}),
109+
});
110+
// const puppeteerLayer = new lambda.LayerVersion(this, "PuppeteerSupportLayer", {
111+
// compatibleRuntimes: [lambda.Runtime.NODEJS_16_X],
112+
// code: lambda.Code.fromAsset("node_modules/chrome-aws-lambda/build", {}),
113+
// });
104114
const generateDocumentFn = new nodejs.NodejsFunction(this, "GenerateDocumentFunction", {
105115
entry: "document-generation/generate-document.ts",
116+
runtime: lambda.Runtime.NODEJS_16_X,
117+
memorySize: 512,
118+
layers: [documentGenerationLayer /* , puppeteerLayer */],
119+
timeout: cdk.Duration.seconds(120),
106120
});
107121
generateDocumentResource.addMethod(HttpMethod.POST, new apigw.LambdaIntegration(generateDocumentFn));
108122
}

0 commit comments

Comments
 (0)