Skip to content

Instantly share code, notes, and snippets.

@thomasmichaelwallace
thomasmichaelwallace / taskdef-to-env.ts
Created May 8, 2024 10:36
Convert an ECS task definition into a dot env file
import {
GetSecretValueCommand,
SecretsManagerClient,
} from '@aws-sdk/client-secrets-manager';
import fs from 'fs';
import path from 'path';
// usage npx tsx taskdef-to-env.ts path/to/ecs/task-definition.json
// outputs: /path/to/ecs/.env.local
// expects aws to be configured (see aws-vault)

Terraforming API Gateway to SQS queue

Example of a bare-minimum terraform script to setup an API Gateway endpoint that takes records and puts them into an SQS queue.

SQS

Start by creating the SQS queue.

resource "aws_sqs_queue" "queue" {