Skip to content

Add architecture to RustExtension #76

@garysassano

Description

@garysassano

The compatiblearchitectures property is not available in RustExtension, so it always compiles for x64.

A workaround is to manually specify the architecture flag in the bundling property:

const myExtension = new RustExtension(
  this,
  "MyExtension",
  {
    manifestPath: join(
      __dirname,
      "..",
      "layers/my-extension",
      "Cargo.toml",
    ),
    bundling: { cargoLambdaFlags: ["--quiet", "--arm64"] },
  },
);

It would be more convenient to introduce an architecture property that accepts either Architecture.X86_64 (default) or Architecture.ARM_64. Setting this property would not only automatically add the --arm64 flag but also configure the layer correctly in the AWS Console:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions