Skip to content

Commit 5abe356

Browse files
author
github-actions
committed
chore(release): v0.0.32
1 parent 9f0e10c commit 5abe356

File tree

6 files changed

+44
-5
lines changed

6 files changed

+44
-5
lines changed

cargolambdacdk/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2024 David Calavera
1+
Copyright (c) 2025 David Calavera
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

cargolambdacdk/README.md

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ new RustFunction(this, 'Rust function', {
177177

178178
To force bundling in a docker container even if `Cargo Lambda` is available in your environment, set the `forcedDockerBundling` prop to `true`. This is useful if you want to make sure that your function is built in a consistent Lambda compatible environment.
179179

180-
By default, these constructs use `ghcr.io/cargo-lambda/cargo-lambda` as the image to build with. Use the `bundling.dockerImage` prop to use a custom bundling image:
180+
By default, these constructs use [ghcr.io/cargo-lambda/cargo-lambda](https://github.com/cargo-lambda/cargo-lambda/pkgs/container/cargo-lambda) as the image to build with. Use the `bundling.dockerImage` prop to use a custom bundling image:
181181

182182
```go
183183
import { RustFunction } from 'cargo-lambda-cdk';
@@ -208,6 +208,45 @@ new RustFunction(this, 'Rust function', {
208208

209209
This property mirrors values from the `cdk.BundlingOptions` and is passed into `Code.fromAsset`.
210210

211+
If you want to use a custom Docker image, you can use the `bundling.dockerImage` prop:
212+
213+
```go
214+
import { RustFunction } from 'cargo-lambda-cdk';
215+
216+
new RustFunction(this, 'Rust function', {
217+
manifestPath: 'path/to/package/directory/with/Cargo.toml',
218+
bundling: {
219+
dockerImage: DockerImage.fromRegistry('your_docker_image'),
220+
},
221+
});
222+
```
223+
224+
If you want to mount additional volumes to the Docker container, you can use the `dockerOptions.volumes` prop. This is useful if you want to mount Cargo's cache directory to speed up the build process. The `CARGO_HOME` in the default image is `/usr/local/cargo`.
225+
226+
```go
227+
import { RustFunction } from 'cargo-lambda-cdk';
228+
import { homedir } from 'os';
229+
import { join } from 'path';
230+
231+
const cargoHome = process.env.CARGO_HOME || join(homedir(), '.cargo');
232+
233+
new RustFunction(this, 'Rust function', {
234+
manifestPath: 'path/to/package/directory/with/Cargo.toml',
235+
bundling: {
236+
dockerOptions: {
237+
volumes: [{
238+
hostPath: join(cargoHome, 'registry'),
239+
containerPath: '/usr/local/cargo/registry',
240+
},
241+
{
242+
hostPath: join(cargoHome, 'git'),
243+
containerPath: '/usr/local/cargo/git',
244+
}],
245+
},
246+
},
247+
});
248+
```
249+
211250
### Command hooks
212251

213252
It is possible to run additional commands by specifying the `commandHooks` prop:
-1.79 MB
Binary file not shown.
1.79 MB
Binary file not shown.

cargolambdacdk/jsii/jsii.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
constructs "github.com/aws/constructs-go/constructs/v10/jsii"
1414
)
1515

16-
//go:embed cargo-lambda-cdk-0.0.31.tgz
16+
//go:embed cargo-lambda-cdk-0.0.32.tgz
1717
var tarball []byte
1818

1919
// Initialize loads the necessary packages in the @jsii/kernel to support the enclosing module.
@@ -24,5 +24,5 @@ func Initialize() {
2424
constructs.Initialize()
2525

2626
// Load this library into the kernel
27-
_jsii_.Load("cargo-lambda-cdk", "0.0.31", tarball)
27+
_jsii_.Load("cargo-lambda-cdk", "0.0.32", tarball)
2828
}

cargolambdacdk/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.31
1+
0.0.32

0 commit comments

Comments
 (0)