https://serverless-stack.com/ logo
#sst
Title
# sst
b

Bhuvaneshwaran R

08/24/2021, 2:17 PM
Is it possible to deploy only one function even though if stack has multiple functions?
t

thdxr

08/24/2021, 2:25 PM
Unfortunately it's not possible with how cloudformation works. Can you tell me a bit more about why you want to do this?
a

Adrián Mouly

08/24/2021, 2:26 PM
But SLS does it, how it does it?
t

thdxr

08/24/2021, 2:28 PM
They deploy it manually outside of cloudformation using the aws api directly. I think we need to understand the workflows where people want to do this better so we can think about how to address them
We might need to start considering this as there's a related issue around switching between start vs deploy being made faster by just swapping out the zip files in lambda
a

Adrián Mouly

08/24/2021, 2:29 PM
That makes sense.
b

Bhuvaneshwaran R

08/24/2021, 3:08 PM
I need to onboard the customer based on their features request. Let's assume x client want a,b,c feature which present in stack and y client want a,b feature which present in the same stack. So while onboarding the customer I don't want to deploy the c feature for y client.
If is there any alternate way please let me know.
@thdxr Do we have any alternate way?
t

thdxr

08/25/2021, 12:02 PM
Are you deploying a stack per customer? You should pass in props to the stack to determine what to deploy
b

Bhuvaneshwaran R

08/25/2021, 12:44 PM
No. I'm not using stack per customer. I don't want to deploy a function in stack based in customer feature request. Do you've any example?
t

thdxr

08/25/2021, 12:46 PM
You can pass in props into the stack to determine what to deploy. I'll write an example soon, however I'm not sure how you can deploy multiple versions of your app without creating a new instance of a stack per customer
Copy code
new Stack(app, "Customer1", { feature1: false })
Then in the stack you can avoid deploying certain features if feature1 === false