1
0
Fork
You've already forked nims-tofu-cloud
0
No description
  • HCL 60.4%
  • Nim 17.2%
  • Shell 15%
  • Dockerfile 7.4%
Find a file
2025年05月27日 14:15:37 -03:00
.github/workflows ci(build): tag name 2025年05月25日 10:53:35 -03:00
infra docs(readme): fix infra diagram 2025年05月27日 14:15:37 -03:00
src feat(app): logging 2025年05月25日 12:49:36 -03:00
tests feat(app): simple auth 2025年05月25日 08:01:30 -03:00
.dockerignore feat: dockerfile 2025年05月25日 08:53:42 -03:00
.editorconfig feat: hello world server and tests 2025年05月25日 07:27:43 -03:00
.env.example feat(app): simple auth 2025年05月25日 08:01:30 -03:00
.gitignore fix: infra 2025年05月25日 15:30:57 -03:00
config.nims feat: dockerfile 2025年05月25日 08:53:42 -03:00
Dockerfile fix(dockerfile): deliver a clean image after build 2025年05月25日 10:47:29 -03:00
nims_tofu_cloud.nimble feat(app): simple auth 2025年05月25日 08:01:30 -03:00
readme.org docs(readme): fix infra diagram 2025年05月27日 14:15:37 -03:00

Nim's Tofu Cloud

Nim Hello World HTTP server deployed on AWS ECS via Open Tofu.

Learning purposes

Infra

architecture-beta
 group vpc(cloud)[VPC]
 group cluster(server)[ECS Cluster] in vpc
 service ecs_service(server)[ECS Service] in cluster
 group task_group(server)[ECS Task Definition] in vpc
 service container(server)[Container] in task_group
 group subnets(cloud)[Public Subnets] in vpc
 service ecs_task(server)[ECS Task] in subnets
 service sg(cloud)[Security Group] in vpc
 service role(cloud)[IAM Role for ECS Task Execution]
 service logs(cloud)[CloudWatch Log Group]
 service internet(cloud)[Internet]
 container:R -- L:logs
 ecs_service:T -- B:sg
 ecs_service:R -- L:ecs_task
 ecs_task:T -- B:container
 role:L -- R:ecs_task
 internet:T -- B:ecs_task

Usage Locally

Build The Server

nimble build_release

Set .env

SECRET=passphrase

Running

./build/nims_tofu_cloud

Call the API

curl 'http://localhost:5000?secret=passphrase'
{"message":"Hello, World!"}

Usage With Docker

Build Docker Image

docker build .

Run the Image

docker run \
 --rm \
 -p 5000:5000 \
 --env SECRET=hello \
 $IMAGE_SHA256

Call the API

curl 'http://localhost:5000?secret=hello'
{"message":"Hello, World!"}

Run Hurl Tests

nimble test

Development Steps

  1. Hello World application that requires a secret to respond.
  2. Docker Image building and pushing
  3. Define the infrastructure