Albert
01/27/2022, 12:03 PMthdxr
01/27/2022, 1:12 PMAlbert
01/27/2022, 1:15 PMthdxr
01/27/2022, 1:16 PMAlbert
01/27/2022, 1:18 PM${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}
thdxr
01/27/2022, 1:19 PMthdxr
01/27/2022, 1:20 PMAlbert
01/27/2022, 1:20 PMFrank
the debugging doesn’t work properlydo you mean the stack name for the debug stack?
Albert
01/28/2022, 4:13 PMmodule.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.Jay
Frank