Skip to content

Latest commit

 

History

History
35 lines (22 loc) · 891 Bytes

README.md

File metadata and controls

35 lines (22 loc) · 891 Bytes

Terraform API Example

A simple CDKTF application behind an API interface, as a demonstration for a blog post.

Requirements

Installing dependencies

npm i

Or your favorite alternative dependency manager

Starting the dev server

npm run dev

This will server the API on localhost:3000 by default.

Testing the API

You can test the API by running:

curl -X POST -H "Content-Type: application/json" -d '{ "name": "my-stack", "buckets": ["test", "test1"] }' http://localhost:3000/generate > my-stack.zip 

This should produce an output zip container a tf stack for deploying two s3 buckets named test and test1.