Skip to content

nitrictech/Terraform-API-Example

Repository files navigation

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.

About

An example of putting cdktf behind an API

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published