1.0.4 • Published 4 years ago

fargate-cpu-picker v1.0.4

Weekly downloads
1
License
ISC
Repository
github
Last release
4 years ago

About

A helper library written in TypeScript to support AWS CDK development i.e. building ECS Task Definition. It will suggest the minimum/maximum CPU (vCPU) based on memory/RAM needed to run an ECS task.

Repositories

Setup

You may need to add DOM to the lib section in your tsconfig.json file like so:

{
  "compilerOptions": {
    // code omitted for brevity
    "lib": [
      "es2018",
      "DOM"
    ],
    // code omitted for brevity...
  }
}

Usage

import { pick } from "fargate-cpu-picker";

// Return minimum vCPU supported for 0.5GB memory
const minCPU = pick("0.5", "min"); // 256

// Without second parameter, it will fallback to minimum too
const minCPU = pick("0.5"); // 256

// Return maximum vCPU supported for 2GB memory
const maxCPU = pick("2", "max"); // 1024

Previous Releases

If you need to refer at specific version of this package, it's available here. They were created using np (it's cool - you should check it out).

Contribute

Feel free to fork and submit PRs for this project. I'm more than happy to review and merge it. If you have any questions regarding contributing, feel free to reach out to me on Twitter.

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago