SST right now seems to create the CloudFormation s...
# help
SST right now seems to create the CloudFormation stacks named this way…
[stage]-[sst.json name]-[stack instance name]
However, we have a stack naming convention we like to follow that we want to be
Eg. service = my-app stage = dev // my-app-dev Is there a way to override the SST stackname?
I was using same convention.
But I would recommend to move to the standard one.
Due SST is designed to have X amount of environments, one for developer or PR.
This standard convention works better for that.
It might be the place we eventually move to, but we have a number of services that rely on this stack naming convention. Is there any way to override?
Our format is the same as serverless frameworks and “stage” is synonymous with “environment” of which you can also have many of without collisions
Hey Dan, can you try this?
Copy code
new MyStack(app, "my-stack", {
  stackName: `my-stack-${app.stage}`,
unfortnately I got an error saying
Copy code
Error: Stack (my-stack-dev) is not prefixed with the stage. Use sst.Stack or the format {stageName}-my-stack-dev.
@Frank I guess there is some checking that is happening to prevent changing the format to not be prefixed with stage?
Oh right! @Camilo Bravo sorry about that. We should definitely allow this. Lemme talk to the team and get back to you.
Just to clarify, by
did @Dan Van Brunt mean
[stack instance name]-[stage]
So if your
looked like this:
Copy code
new ApiStack(app, "api");
You want to name the stack
, correct?
exactly @Frank thats right
Got it! Will follow up on this.
@Camilo Bravo @Dan Van Brunt I just opened an issue with the proposed solution
We will change it to allow stack name starts with
, ends in
, or contains
. It just has to be parameterized with the stage name, at least for now.
That should work for u guys right?
yeah that will work for us
sounds good!
@Frank any idea if anyone will pick this one up soon? We’re close to needing it now. If not, I’ll take a peak tonight/tomorrow.
Hey @Dan Van Brunt, I can take a look at this today!
Hey @Dan Van Brunt @Camilo Bravo, release v0.46.0 has got the changes above. Give it a try and let me know if it works for you guys!