Aro
Aro

Reputation: 199

SST(Serverless Stack) : Migration from the V2 to V3.3.21

SST (Serverless Stack) is an open-source framework developed by Anomaly Innovations that helps you build and deploy serverless applications on AWS. It offers several features and tools to make developing serverless applications easier and more efficient.

I am migrating from the V2 to V3.3.21 so this is my sst.config.ts

import { SSTConfig } from "sst";
import { MyStack } from "./stack/MyStack";

export default {
  config(_input) {
    return {
      name: "app",
      region: "us-east-1",
    };
  },
  stacks(app) {
    app.setDefaultFunctionProps({
      runtime: "nodejs20.x",//runtime for the generated functions to ss
    });

    app.addDefaultFunctionPermissions("*");//lambda functions permissions

    app.stack(MyStack);
    // app.stack(Dynamo);
  },
} satisfies SSTConfig;

and I wish to know where is the SSTConfig gone? Or what is the replacement for it? Thank you for your help. I've searched for the whole web, but this version is recent (at the moment I write this post), so I found any docs about the migration from V2.x to V3.3.21

Upvotes: 0

Views: 55

Answers (1)

telgueta
telgueta

Reputation: 1

Probably you already fix this, but here it goes. In sst v3 the SSTConfig does not exist anymore and you have to call the function config like this:

/// <reference path="./.sst/platform/config.d.ts" />

export default $config({
  app(input) {}
})

Inside the return of the app you set the main parameters of your app, and in the return of the config you set the components you want to create (functions, cron, etc)

Upvotes: 0

Related Questions