This commit is contained in:
frostebite
2026-01-24 20:32:36 +00:00
parent 5c9bac600a
commit 53dacd92e1
3 changed files with 41 additions and 9 deletions
Generated Vendored
+21 -4
View File
@@ -1609,17 +1609,34 @@ class AWSBaseStack {
Parameters: parameters,
Capabilities: ['CAPABILITY_IAM'],
};
const stacks = await CF.send(new client_cloudformation_1.ListStacksCommand({ StackStatusFilter: ['UPDATE_COMPLETE', 'CREATE_COMPLETE', 'ROLLBACK_COMPLETE'] }));
const stacks = await CF.send(new client_cloudformation_1.ListStacksCommand({
StackStatusFilter: ['CREATE_IN_PROGRESS', 'UPDATE_IN_PROGRESS', 'UPDATE_COMPLETE', 'CREATE_COMPLETE', 'ROLLBACK_COMPLETE'],
}));
const stackNames = stacks.StackSummaries?.map((x) => x.StackName) || [];
const stackExists = stackNames.includes(baseStackName) || false;
const stackExists = stackNames.includes(baseStackName);
const describeStack = async () => {
return await CF.send(new client_cloudformation_1.DescribeStacksCommand(describeStackInput));
};
try {
if (!stackExists) {
cloud_runner_logger_1.default.log(`${baseStackName} stack does not exist (${JSON.stringify(stackNames)})`);
await CF.send(new client_cloudformation_1.CreateStackCommand(createStackInput));
cloud_runner_logger_1.default.log(`created stack (version: ${parametersHash})`);
let created = false;
try {
await CF.send(new client_cloudformation_1.CreateStackCommand(createStackInput));
created = true;
}
catch (error) {
const message = `${error?.name ?? ''} ${error?.message ?? ''}`;
if (message.includes('AlreadyExistsException')) {
cloud_runner_logger_1.default.log(`Base stack already exists, continuing with describe`);
}
else {
throw error;
}
}
if (created) {
cloud_runner_logger_1.default.log(`created stack (version: ${parametersHash})`);
}
}
const CFState = await describeStack();
let stack = CFState.Stacks?.[0];
Generated Vendored
+1 -1
View File
File diff suppressed because one or more lines are too long