Can I set function defaults that only get added to...
# sst
k
Can I set function defaults that only get added to the functions of one stack? E.x I have multiple services and I want defaults for each service stack to be different?
b
I’m not sure you can do this directly from the
App
construct props, but
App.defaultFuncitonProps
is an array of either objects or callbacks. The callback take a stack as an argument so I could you could register a function with
App.setDefaultFunctionProps
and do your conditional checks in there?
Copy code
app.setDefaultFunctionProps((stack) => {
        switch (stack.stackName) {
            case "stack-1":
                return {};

            case "stack-2":
                return {};

            ...

        }
    });
t
Working on this today
k
Ok awesome @Brinsley thanks for the workaround. and @thdxr thanks for working on this this is a very useful feature I think
t
k
And a million others 😂
t
everybody wants it!