ecs logic

This commit is contained in:
Ishaan Dey
2024-05-17 23:18:15 -07:00
parent 7981af1451
commit 14ea89d690
5 changed files with 1229 additions and 28 deletions

View File

@ -10,10 +10,9 @@ import {
} from "./types";
import {
DeleteServiceCommand,
DescribeServicesCommand,
ECSClient,
StartTaskCommand,
StopTaskCommand,
} from "@aws-sdk/client-ecs";
dotenv.config();
@ -178,10 +177,11 @@ export const getProjectSize = async (id: string) => {
return (await res.json()).size;
};
export const stopServer = async (task: string) => {
const command = new StopTaskCommand({
cluster: "arn:aws:ecs:us-east-1:767398085538:service/Sandbox/Sandbox",
task,
export const stopServer = async (service: string) => {
const command = new DeleteServiceCommand({
cluster: "Sandbox",
service,
force: true,
});
try {