Currently I’m developing an API REST with NodeJS. What I want to do is everytime an User register in my system, create a new droplet, deploy and run an instance of the API REST previously mentioned and add a new DNS record for that new Droplet.

I don’t know if I can achieve that requirement with tools like Chef or Terraform.

Any ideas?

Thanks in advance.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

You could integrate your API with the digital ocean API and create a new Droplet (with the help of the request module).

https://developers.digitalocean.com/documentation/v2/#droplets

You could use the same API to create your DNS records by the looks of things.

https://developers.digitalocean.com/documentation/v2/#domain-records

I imagine that you’re probably already aware that this level of automation is risky business (given that you could incur significant charges if your API is insecure).

Good luck!

Submit an Answer