Skip to content

Instantly share code, notes, and snippets.

View martysweet's full-sized avatar

Marty Sweet martysweet

View GitHub Profile
@martysweet
martysweet / fargate_task_size.tf
Last active May 25, 2023 14:13
Calculates the next largest valid Task Definition size for a Fargate container given an summed cpu and memory value. This can be useful for creating modules that handle multiple sidecars behind the scenes, while still exposing access for users to control their container resources.
locals {
# To find the ECS Fargate Task Size, we need to find the next size up from the total sum of all the containers.
# Creates an ordered list of (x, y) points, from smallest to largest possible Task sizes
# Plotted on a graph, by (cpu, mem) it will be multiple series of vertical plots
configs = concat(
setproduct([256], [512, 1024, 2048]),
setproduct([512], range(1024, 4096, 1024)), # CPU 512 | MEM 1024, 2048, 3072, 4096
setproduct([1024], range(2048, 8192, 1024)), # Range args (start, finish, increment)
setproduct([2048], range(4096, 16384, 1024)),
@martysweet
martysweet / myfile.txt
Last active February 10, 2023 12:27
Howdy Partnert
yoohooo

Keybase proof

I hereby claim:

  • I am martysweet on github.
  • I am martysweet (https://keybase.io/martysweet) on keybase.
  • I have a public key ASDb6QGR-BRFfgWXyG4Sp0Tljc5pmK0-8HZbMbwq08s2KQo

To claim this, I am signing this object: