Skip to content

Commit 5410e10

Browse files
authored
fix(bundling): enclosing metafile & tsconfig paths with quotes (#32725)
### Issue # (if applicable) No ### Reason for this change Generating the metafile in a Windows environment can fail when the path are not enclosed with quotes. ### Description of changes #### What code changes did you make? Enclosed paths the bundling arguments `--metafile` and `--tsconfig` #### Have you made any important design decisions? No #### What AWS use cases does this change enable? To enable the use cases, which AWS service features are utilized? Allows safe usage of `metafile` and `tsconfig` bundling options ### Describe any new or updated permissions being added <!— What new or updated IAM permissions are needed to support the changes being introduced ? --> ### Description of how you validated changes #### Have you added any unit tests and/or integration tests? No, but when you have a project path with a whitespace, and use the `metafile` bundling argument, the metafile path should be passed correctly within quotes to esbuild. I updated the existing tests. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 4c42800 commit 5410e10

File tree

13 files changed

+559
-13
lines changed

13 files changed

+559
-13
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { mult } from '../util';
2+
3+
export async function handler(): Promise<void> {
4+
console.log(mult(3, 4)); // eslint-disable-line no-console
5+
}

packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.function.js.snapshot/asset.2853b22adf0b1929f5ccd54840d96d298c0ba574aa7a5bd02df65295244d1085/index.js

+39
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.function.js.snapshot/asset.2853b22adf0b1929f5ccd54840d96d298c0ba574aa7a5bd02df65295244d1085/index.meta.json

+36
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.function.js.snapshot/cdk-integ-lambda-nodejs.assets.json

+16-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.function.js.snapshot/cdk-integ-lambda-nodejs.template.json

+106
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,112 @@
212212
"jshandlerbundlingpathServiceRole827F7127"
213213
]
214214
},
215+
"jshandlertsconfigpathServiceRoleC592AD71": {
216+
"Type": "AWS::IAM::Role",
217+
"Properties": {
218+
"AssumeRolePolicyDocument": {
219+
"Statement": [
220+
{
221+
"Action": "sts:AssumeRole",
222+
"Effect": "Allow",
223+
"Principal": {
224+
"Service": "lambda.amazonaws.com"
225+
}
226+
}
227+
],
228+
"Version": "2012-10-17"
229+
},
230+
"ManagedPolicyArns": [
231+
{
232+
"Fn::Join": [
233+
"",
234+
[
235+
"arn:",
236+
{
237+
"Ref": "AWS::Partition"
238+
},
239+
":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
240+
]
241+
]
242+
}
243+
]
244+
}
245+
},
246+
"jshandlertsconfigpath74546CB1": {
247+
"Type": "AWS::Lambda::Function",
248+
"Properties": {
249+
"Code": {
250+
"S3Bucket": {
251+
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
252+
},
253+
"S3Key": "6c52cc5df44f0d18474ce4399377d62ee08c9b9cb11855fb95070dcd83a5a6ea.zip"
254+
},
255+
"Handler": "index.handler",
256+
"Role": {
257+
"Fn::GetAtt": [
258+
"jshandlertsconfigpathServiceRoleC592AD71",
259+
"Arn"
260+
]
261+
},
262+
"Runtime": "nodejs18.x"
263+
},
264+
"DependsOn": [
265+
"jshandlertsconfigpathServiceRoleC592AD71"
266+
]
267+
},
268+
"tshandlermetafilepathServiceRoleECB676AC": {
269+
"Type": "AWS::IAM::Role",
270+
"Properties": {
271+
"AssumeRolePolicyDocument": {
272+
"Statement": [
273+
{
274+
"Action": "sts:AssumeRole",
275+
"Effect": "Allow",
276+
"Principal": {
277+
"Service": "lambda.amazonaws.com"
278+
}
279+
}
280+
],
281+
"Version": "2012-10-17"
282+
},
283+
"ManagedPolicyArns": [
284+
{
285+
"Fn::Join": [
286+
"",
287+
[
288+
"arn:",
289+
{
290+
"Ref": "AWS::Partition"
291+
},
292+
":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
293+
]
294+
]
295+
}
296+
]
297+
}
298+
},
299+
"tshandlermetafilepath3B73FC2C": {
300+
"Type": "AWS::Lambda::Function",
301+
"Properties": {
302+
"Code": {
303+
"S3Bucket": {
304+
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
305+
},
306+
"S3Key": "2853b22adf0b1929f5ccd54840d96d298c0ba574aa7a5bd02df65295244d1085.zip"
307+
},
308+
"Handler": "index.handler",
309+
"Role": {
310+
"Fn::GetAtt": [
311+
"tshandlermetafilepathServiceRoleECB676AC",
312+
"Arn"
313+
]
314+
},
315+
"Runtime": "nodejs18.x"
316+
},
317+
"DependsOn": [
318+
"tshandlermetafilepathServiceRoleECB676AC"
319+
]
320+
},
215321
"Vpc8378EB38": {
216322
"Type": "AWS::EC2::VPC",
217323
"Properties": {

packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.function.js.snapshot/cdk.out

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.function.js.snapshot/integ.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.function.js.snapshot/manifest.json

+26-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)