better aws commands
parent
1ff1597a05
commit
fa7bd794ae
|
|
@ -2011,10 +2011,12 @@ class AwsCliCommands {
|
||||||
process.env.AWS_REGION = input_1.default.region;
|
process.env.AWS_REGION = input_1.default.region;
|
||||||
const CF = new aws_sdk_1.default.CloudFormation();
|
const CF = new aws_sdk_1.default.CloudFormation();
|
||||||
const stacks = ((_a = (yield CF.listStacks().promise()).StackSummaries) === null || _a === void 0 ? void 0 : _a.filter((_x) => _x.StackStatus !== 'DELETE_COMPLETE')) || [];
|
const stacks = ((_a = (yield CF.listStacks().promise()).StackSummaries) === null || _a === void 0 ? void 0 : _a.filter((_x) => _x.StackStatus !== 'DELETE_COMPLETE')) || [];
|
||||||
|
cloud_runner_logger_1.default.log(`DescribeStacksRequest ${stacks.length}`);
|
||||||
for (const element of stacks) {
|
for (const element of stacks) {
|
||||||
cloud_runner_logger_1.default.log(JSON.stringify(element, undefined, 4));
|
cloud_runner_logger_1.default.log(JSON.stringify(element, undefined, 4));
|
||||||
cloud_runner_logger_1.default.log(`${element.StackName}`);
|
cloud_runner_logger_1.default.log(`${element.StackName}`);
|
||||||
perResultCallback(element);
|
if (perResultCallback)
|
||||||
|
yield perResultCallback(element);
|
||||||
}
|
}
|
||||||
if (stacks === undefined) {
|
if (stacks === undefined) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -2033,13 +2035,12 @@ class AwsCliCommands {
|
||||||
};
|
};
|
||||||
const list = (yield ecs.listTasks(input).promise()).taskArns || [];
|
const list = (yield ecs.listTasks(input).promise()).taskArns || [];
|
||||||
if (list.length > 0) {
|
if (list.length > 0) {
|
||||||
cloud_runner_logger_1.default.log(`DescribeTasksRequest`);
|
|
||||||
cloud_runner_logger_1.default.log(JSON.stringify(list, undefined, 4));
|
|
||||||
const describeInput = { tasks: list, cluster: element };
|
const describeInput = { tasks: list, cluster: element };
|
||||||
const describeList = (yield ecs.describeTasks(describeInput).promise()).tasks || [];
|
const describeList = (yield ecs.describeTasks(describeInput).promise()).tasks || [];
|
||||||
if (describeList === []) {
|
if (describeList === []) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
cloud_runner_logger_1.default.log(`DescribeTasksRequest ${describeList.length}`);
|
||||||
for (const taskElement of describeList) {
|
for (const taskElement of describeList) {
|
||||||
if (taskElement === undefined) {
|
if (taskElement === undefined) {
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -2051,7 +2052,8 @@ class AwsCliCommands {
|
||||||
cloud_runner_logger_1.default.log(`Skipping ${taskElement.taskDefinitionArn} no createdAt date`);
|
cloud_runner_logger_1.default.log(`Skipping ${taskElement.taskDefinitionArn} no createdAt date`);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
perResultCallback(taskElement, element);
|
if (perResultCallback)
|
||||||
|
yield perResultCallback(taskElement, element);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -10,10 +10,11 @@ export class AwsCliCommands {
|
||||||
const CF = new AWS.CloudFormation();
|
const CF = new AWS.CloudFormation();
|
||||||
const stacks =
|
const stacks =
|
||||||
(await CF.listStacks().promise()).StackSummaries?.filter((_x) => _x.StackStatus !== 'DELETE_COMPLETE') || [];
|
(await CF.listStacks().promise()).StackSummaries?.filter((_x) => _x.StackStatus !== 'DELETE_COMPLETE') || [];
|
||||||
|
CloudRunnerLogger.log(`DescribeStacksRequest ${stacks.length}`);
|
||||||
for (const element of stacks) {
|
for (const element of stacks) {
|
||||||
CloudRunnerLogger.log(JSON.stringify(element, undefined, 4));
|
CloudRunnerLogger.log(JSON.stringify(element, undefined, 4));
|
||||||
CloudRunnerLogger.log(`${element.StackName}`);
|
CloudRunnerLogger.log(`${element.StackName}`);
|
||||||
perResultCallback(element);
|
if (perResultCallback) await perResultCallback(element);
|
||||||
}
|
}
|
||||||
if (stacks === undefined) {
|
if (stacks === undefined) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -31,13 +32,12 @@ export class AwsCliCommands {
|
||||||
};
|
};
|
||||||
const list = (await ecs.listTasks(input).promise()).taskArns || [];
|
const list = (await ecs.listTasks(input).promise()).taskArns || [];
|
||||||
if (list.length > 0) {
|
if (list.length > 0) {
|
||||||
CloudRunnerLogger.log(`DescribeTasksRequest`);
|
|
||||||
CloudRunnerLogger.log(JSON.stringify(list, undefined, 4));
|
|
||||||
const describeInput: AWS.ECS.DescribeTasksRequest = { tasks: list, cluster: element };
|
const describeInput: AWS.ECS.DescribeTasksRequest = { tasks: list, cluster: element };
|
||||||
const describeList = (await ecs.describeTasks(describeInput).promise()).tasks || [];
|
const describeList = (await ecs.describeTasks(describeInput).promise()).tasks || [];
|
||||||
if (describeList === []) {
|
if (describeList === []) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
CloudRunnerLogger.log(`DescribeTasksRequest ${describeList.length}`);
|
||||||
for (const taskElement of describeList) {
|
for (const taskElement of describeList) {
|
||||||
if (taskElement === undefined) {
|
if (taskElement === undefined) {
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -49,7 +49,7 @@ export class AwsCliCommands {
|
||||||
CloudRunnerLogger.log(`Skipping ${taskElement.taskDefinitionArn} no createdAt date`);
|
CloudRunnerLogger.log(`Skipping ${taskElement.taskDefinitionArn} no createdAt date`);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
perResultCallback(taskElement, element);
|
if (perResultCallback) await perResultCallback(taskElement, element);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue