Skip to content

Conversation

JoelRoxell
Copy link

@JoelRoxell JoelRoxell commented Aug 4, 2022

What did you implement:

Adds a new custom flag to signal that the serverless.yml is nested in a cargo workspace. Since the binaries will be outputted to a target folder in the workspace root, the zip-copy-process needs to take that into account.

Not sure if this is the most appropriate change; however, it solved my problem.

I want to be able to separate the lambda-projects to isolate different dependencies etc.

custom:
  rust:
    dockerless: true
    inWorkspace: true # <---- Defaults to false

How did you verify your change:

Deployed multiple stacks from the workspace root to AWS using serverless components.

.
├── Cargo.lock
├── Cargo.toml
├── shared-infra
│   └── serverless.yml
├── package.json
├── package-lock.json
├── lambda1 # rest api
│   ├── Cargo.toml
│   ├── serverless.yml
│   ├── src
│   │   ├── handler.rs
│   │   └── main.rs
│   └── target
│       └── lambda
│           └── release
│               └── lambda1.zip
├── lambda2 # queue-consumer
│   ├── Cargo.toml
│   ├── serverless.yml
│   ├── src
│   │   ├── handler.rs
│   │   ├── main.rs
│   │   └── messages.rs
│   └── target
│       └── lambda
│           └── release
│               └── lambda2.zip
├── serverless-compose.yml
├── target
│   ├── release
│   └── x86_64-unknown-linux-musl
│       └── release
│           ├── lambda1
│           ├── lambda1.d
│           ├── lambda2
│           └── lambda2.d
└── yarn.lock

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant