Hey everyone, is there any way to override the log...
# help
a
Hey everyone, is there any way to override the logicalPrefixedName in the app level instance?
t
Do you mean override the function?
a
Yes because I want the stack names for debugging to be different not the ones that are auto generated using that method when I run sst start
t
Sorry can you explain more? You should be using stage to keep your development environments seperate
a
Let me say I run sst start --stage dev, this goes and creates all stacks like this:
${stage}-${app_name}-${stack_name}
what I need is a permutation of this because of internal company requirements I need something like
${app_name}-${stage_name}-{stack_name}
t
I think you can pass stackName in the super call in the stack constructor
@Frank might have a better idea on how to change the logic globally
a
But when I do that the debugging I think doesn't work properly
f
Hey @Albert by
the debugging doesn’t work properly
do you mean the stack name for the debug stack?
a
Hey @Frank, I believe there is a piece of code here that explains what I mean, this is how you handle the Normalization of the stack name:
Copy code
module.exports = async function (argv, config, cliInfo) {
  // Normalize stack name
  const stackPrefix = `${config.stage}-${config.name}-`;
  let stackName = argv.stack;
  if (stackName) {
    stackName = stackName.startsWith(stackPrefix)
      ? stackName
      : `${stackPrefix}${stackName}`;
  }
This means that the normalize stack name always pre-assumes that the stackName should start with stackPrefix which for you is
${config.stage}-${config.name}
I need a permutation of this, I want all my stacks to be named with this prefix:
${config-name}-${config.stage}
And when this is done this logic adds the logical prefix to the stack name, for example if I name my stacks as:
${config.name}-${config.stage}
what happens is this logic increments the prefixed logic and I end up with something like this:
${config.stage}-${config.name}-${config.name}-${config.stage}
so it duplicates data. I believe that if the stackName is given in the stackName props this should be overridden always and not check if the prefixed logical name is part of the string and add it to the name because that causes this issue of duplications . One way to handle this is also adding the permutation to the if logic and say if the user has prefixed any order of stage and name do not add it to the string.
j
@Frank just circling back on this.
f
Hey @Albert, sorry for the delayed follow up. This should be fixed in a recent release.