ECS Fargate cluster with X-Ray Golang application instrumentation.
Create the infrastructure:
terraform -chdir=aws init
terraform -chdir=aws apply -auto-approve
A sampling rule will be created and detect incoming requests for /api/*
. The X-Ray SDK automatically uses this sampling rule based on the scope settings.
Once the cluster is created, build and push the Golang application image to ECR:
bash ./app-golang/ecr.sh
Deploying the Node.js version of the application:
bash ./app-nodejs/ecr.sh
Reference to init a new TypeScript project with yarn
in case it helps setting up the environment:
corepack enable
yarn init -2
yarn add typescript --dev
yarn tsc --init
Running locally:
nvm use 18
yarn install
yarn dev