Repository: cdklabs/aws-lambda-rust (language: python)

Issue:
Issue with node_module path when deploying
When trying to use this module I receive an error stating that a node_module path can't be found.

`ERROR: unable to prepare context: path "/Users/<username>/source/github/zero2prod/cdk/node_modules/@cdklabs/aws-lambda-rust/src" not found`

When checking my local filesystem, I can confirm that the /src folder does not exist.

I do have a slightly different setup, in that my cdk project sits in an adjacent folder to my Rust code. As opposed to in a child folder. My CDK definition looks like this

```
const rustFunction = new rust.RustFunction(this, "RustApiFunction", {
      entry: '../src/api/Cargo.toml',
      memorySize: 256,
      architecture: Architecture.ARM_64,
      bundling: {
        forceDockerBundling: true
      }
    });
```

I've tried with forceDockerBundling set to both true and false.


Discussion / hints:
If you wanted to test this out, you could clone my [GitHub Repo](https://github.com/jeastham1993/zero-to-production-rust) and update the CDK code in the [api-stack.ts](https://github.com/jeastham1993/zero-to-production-rust/blob/main/cdk/lib/api-stack.ts) to use the Rust Function construct instead of Docker bundling.

Fix patch:
diff --git a/src/Dockerfile b/Dockerfile
similarity index 100%
rename from src/Dockerfile
rename to Dockerfile
diff --git a/src/bundling.ts b/src/bundling.ts
index 69cff7a..bd57019 100644
--- a/src/bundling.ts
+++ b/src/bundling.ts
@@ -111,7 +111,7 @@ export class Bundling implements CdkBundlingOptions {
       !checkInstalledTarget(toTarget(this.props.architecture));
     this.image = shouldBuildImage
       ? props.dockerImage ??
-        DockerImage.fromBuild(path.join(__dirname, '../src'), {
+        DockerImage.fromBuild(path.join(__dirname, '../'), {
           buildArgs: {
             ...(props.buildArgs ?? {}),
             // If runtime isn't passed use regional default, lowest common denominator is node18


Test patch:
diff --git a/test/bundling.test.ts b/test/bundling.test.ts
index 8284c14..cedea0a 100644
--- a/test/bundling.test.ts
+++ b/test/bundling.test.ts
@@ -80,7 +80,7 @@ describe('Bundling in Docker', () => {
     );
 
     expect(DockerImage.fromBuild).toHaveBeenCalledWith(
-      expect.stringMatching(/aws-lambda-rust\/src$/),
+      expect.stringMatching(/aws-lambda-rust\/$/),
       expect.objectContaining({
         buildArgs: expect.objectContaining({
           IMAGE: expect.stringMatching(/build-provided.al2023$/),
@@ -274,7 +274,7 @@ describe('Bundling in Docker', () => {
     });
 
     expect(DockerImage.fromBuild).toHaveBeenCalledWith(
-      expect.stringMatching(/src$/),
+      expect.stringMatching(/aws-lambda-rust\/$/),
       expect.objectContaining({
         buildArgs: expect.objectContaining({
           HELLO: 'WORLD',
diff --git a/test/docker.test.ts b/test/docker.test.ts
index 8298cf0..d5990fe 100644
--- a/test/docker.test.ts
+++ b/test/docker.test.ts
@@ -6,7 +6,7 @@ const docker = process.env.CDK_DOCKER ?? 'docker';
 beforeAll(() => {
   const process = spawnSync(
     docker,
-    ['build', '-t', 'cargo-builder', path.join(__dirname, '../src')],
+    ['build', '-t', 'cargo-builder', path.join(__dirname, '../')],
     { stdio: 'inherit' },
   );
   expect(process.error).toBeUndefined();
diff --git a/test/integ.function-bins.ts b/test/integ.function-bins.ts
index 0529e3e..46154cc 100644
--- a/test/integ.function-bins.ts
+++ b/test/integ.function-bins.ts
@@ -15,6 +15,9 @@ class TestStack extends Stack {
     const fn = new RustFunction(this, 'binary1', {
       entry: 'rust-bins/Cargo.toml',
       binaryName: 'my_lambda1',
+      bundling: {
+        forceDockerBundling: true,
+      },
     });
     this.functionName = fn.functionName;
 
diff --git a/test/integ.function-workspace.ts b/test/integ.function-workspace.ts
index 91ec193..0175afb 100644
--- a/test/integ.function-workspace.ts
+++ b/test/integ.function-workspace.ts
@@ -15,6 +15,9 @@ class TestStack extends Stack {
     const fn = new RustFunction(this, 'binary1', {
       entry: 'rust-workspaces/Cargo.toml',
       binaryName: 'my_lambda2',
+      bundling: {
+        forceDockerBundling: true,
+      },
     });
     this.functionName = fn.functionName;
 
diff --git a/test/integ.function.ts b/test/integ.function.ts
index 8989b0b..6268ebe 100644
--- a/test/integ.function.ts
+++ b/test/integ.function.ts
@@ -14,6 +14,9 @@ class TestStack extends Stack {
 
     const fn = new RustFunction(this, 'binary1', {
       entry: 'rust-standalone/Cargo.toml',
+      bundling: {
+        forceDockerBundling: true,
+      },
     });
     this.functionName = fn.functionName;