First-class SST components for Scaleway - Function with Lambda-style esbuild bundling, Bucket, and SST linking that just works.
Published as @galaxfinity/sst-scaleway.
/// <reference path='./.sst/platform/config.d.ts' />
export default $config({
app(input) {
return {
name: 'my-app',
home: 'local',
providers: {
scaleway: '1.51.1',
'@galaxfinity/sst-scaleway': '0.2.0',
},
};
},
async run()
{
// `scw` is injected as a typed global - no import needed.
const bucket = new scw.Bucket('MyBucket');
const fn = new scw.Function('MyApi', {
handler: 'src/index.handler',
link: [bucket],
});
return { url: fn.url };
},
});import { Resource } from 'sst';
export const handler = async () =>
{
return {
statusCode: 200,
body: JSON.stringify({ bucket: Resource.MyBucket.name }),
};
}Linked resources are injected as SST_RESOURCE_* env vars - the exact wire format SST's own components use - so the sst SDK's Resource object works unchanged. Resources linked with scaleway.permission includes get a dedicated IAM application + policy + API key, injected as SST_SCALEWAY_ACCESS_KEY / SST_SCALEWAY_SECRET_KEY / SST_SCALEWAY_APPLICATION_ID secret env vars (the SCW_* prefix is reserved by Scaleway).
sst add scaleway
sst add @galaxfinity/sst-scalewayThis registers both as providers and makes the typed scw.* global available in your sst.config.ts, exactly like aws.* or scaleway.*. Credentials come from the usual Scaleway env vars: SCW_ACCESS_KEY, SCW_SECRET_KEY, SCW_DEFAULT_PROJECT_ID, SCW_DEFAULT_REGION.
Alternatively, skip sst add and use it as a normal package:
pnpm add @galaxfinity/sst-scalewayasync run() {
const scw = await import('@galaxfinity/sst-scaleway');
new scw.Bucket('MyBucket');
}No other dependencies needed either way - @pulumi/pulumi, @pulumiverse/scaleway, esbuild, and archiver all resolve from SST's own vendored platform at runtime.
| Component | Wraps | Status |
|---|---|---|
Function |
functions.Namespace + functions.Function + IAM key wiring |
✅ |
Bucket |
object.Bucket |
✅ |
Postgres |
databases.ServerlessDatabase (scale-to-zero PostgreSQL) |
✅ |
Queue |
mnq.Sqs + mnq.SqsQueue + mnq.SqsCredentials + functions.Trigger
|
✅ |
Cron |
functions.Cron |
✅ |
All functions of an app/stage share one Functions namespace by default (override with namespace). Every component supports SST-style transform and exposes its raw resources via nodes.
Consume queue messages with queue.subscribe("src/consumer.handler") - it creates a private function plus a functions.Trigger, and the message body arrives as the request body. If MNQ SQS is already activated in your project outside this app, pass activateSqs: false to Queue (activation is project-level and can only exist once).
IAM API keys provisioned for linked permissions expire at fixed half-year boundaries (Jun 30 / Dec 31, always 6-12 months out) and rotate automatically on the first deploy of each half-year - deploy at least once per half-year to never hit an expiry.
-
Linking is duck-typed. SST detects linkability via
'getSSTLink' in obj- no dependency on SST internals is needed, and none is taken. The publishedsstpackage doesn't ship the component platform, so this is the supported surface. -
The
scwglobal rides the provider mechanism.sst addaccepts any npm package whose package.json carries apulumifield; SST then installs it into.sst/platform/node_modules, injectsimport * as scw from '@galaxfinity/sst-scaleway'into the config bundle, and generates the typed global inconfig.d.ts. This package is not a real Pulumi provider - it exports an emptyProviderArgsand is never instantiated by the engine - it only borrows the registration channel. If a future SST version tightens that check, the dynamic-import style above keeps working. -
Removal policy is respected. With
removal: "retain", the data-carrying resources (Bucket,Postgres) are retained on removal - the same rule SST applies to its aws data resources, registered here for the Scaleway types.removal: "retain-all"is enforced by SST itself for every resource. Withremoval: "remove", buckets force-destroy their objects so removal actually succeeds. -
sst dev: components deploy normally. Live-invoke is SST-CLI-internal (Go RPC) and not available to third-party components. -
Don't name an import after a provider alias. SST injects the provider imports into every bundled file; internally this package imports the Scaleway SDK as
scwSdkto avoid colliding with bothscalewayand its ownscwalias. - Published as plain, unminified ESM -
$app/$dev/$cliare esbuild defines that must survive in the shipped JS.
See examples/basic - a Bucket linked into a Function using the scw.* global. From that directory: pnpm install && pnpm exec sst install && pnpm exec sst deploy.
Early, but every component is verified end to end against a real Scaleway account with the published package: sst add @galaxfinity/sst-scaleway resolves from the registry and generates the typed scw global; a live request through a deployed Function reads a linked Bucket, queries a linked Postgres (IAM-authenticated), and publishes to a linked Queue; a Cron fires the function on schedule; and a queue.subscribe() trigger consumes the messages and writes them to the bucket via S3 with the injected credentials. API key auto-rotation (create-before-delete, zero downtime) has been observed live.
Known limitation: the activateSqs: false escape hatch for projects with pre-existing MNQ SQS activation is implemented but the conflict scenario itself hasn't been reproduced yet.
This is an independent, community-maintained project. It is not affiliated with, endorsed by, or sponsored by SCALEWAY SAS or by the SST team. 'Scaleway' is a trademark of SCALEWAY SAS; 'SST' and 'Pulumi' are trademarks of their respective owners. These names are used solely to describe what this package is compatible with.
Portions of the internal helpers are derived from SST's MIT-licensed source - see THIRD-PARTY-NOTICES.md.