Alphanumeric image name for stack name

pull/218/head
Frostebite 2021-01-31 20:30:46 +00:00
parent 1531aecf68
commit 55d9b343b6
2 changed files with 3 additions and 2 deletions

File diff suppressed because one or more lines are too long

View File

@ -14,7 +14,8 @@ class AWS {
const ECS = new SDK.ECS(); const ECS = new SDK.ECS();
const CF = new SDK.CloudFormation(); const CF = new SDK.CloudFormation();
const taskDefStackName = `${stackName}-taskDef-${image}`; const alphanumericImageName = image.toString().replace(/[^0-9a-z]/gi, '');
const taskDefStackName = `${stackName}-taskDef-${alphanumericImageName}`;
const stackExists = const stackExists =
(await CF.listStacks().promise()).StackSummaries.find( (await CF.listStacks().promise()).StackSummaries.find(
(x) => x.StackName === taskDefStackName, (x) => x.StackName === taskDefStackName,