A TypeScript-based ecs task definition generator.
pnpm add -D task-definition-ts
- Create an
taskdefinition.ts
file.
import { defineTaskDefinition } from "task-definition-ts";
defineTaskDefinition(
{
// Your task definition goes here
},
// The default output directory is the same as where this file is located
// e.g. if file path is .github/task-defenition/express.ts, .github/task-defenition/express.json is generated.
"path/to/taskdefinition.json",
);
- Run the script to generate taskdefinition.json
npx tsx taskdefenition.ts
If you want to completely remove the JSON file from the codebase, you can generate it on demand in the CI pipeline.
Unfortunately, the package manager doesn't seem to offer a feature to install just one package when a package.json file exists in the project.
So, if you want to use this package without installing all dependencies, you can use this script.
git clone https://github.com/shoma-mano/task-definition-ts ./node_modules/task-definition-ts
This package generates AWS ECS Task Definitions using TypeScript. Please note that the types used in this project were auto-generated by giving docs info to AI, so there might be some inaccuracies or missing definitions.
If you find any issues or improvements, feel free to open a pull request to help us improve the package.