Skip to content

Infrastructure as code generator - from visual diagrams created with Cloudcraft.co to Terraform

License

Notifications You must be signed in to change notification settings

maniacs-oss/modules.tf-lambda

 
 

Repository files navigation

modules.tf - Infrastructure as code generator - from visual diagrams to Terraform

MIT license Gitter

modules.tf - Infrastructure as code generator - from visual diagrams to Terraform

This repository contains code for generating infrastructure as code from visual diagrams created in Cloudcraft.

Code in this repository has been already deployed to AWS Lambda and available for all Cloudcraft users for free (forever):

  • Draw your AWS architecture on Cloudcraft
  • Click "Export" and "Export as code (modules.tf)" at the top right side
  • Download archive and unzip it
  • Follow the instructions in README.md file to get resources created on your AWS account.

Supporters

Cloudcraft - the best way to draw AWS diagrams

This project was partially sponsored by Cloudcraft - the best way to draw AWS diagrams.

Monitoring of serverless applications provided by Dashbird.io. Dashbird - Monitor serverless applications

I am developer - show me the code & let's ship it!

Ok, if you are a developer and want to contribute, this is really great because I need your help:

  • Report, triage and fix bugs
  • Refactor code
  • Improve documentation
  • Implement new sources and workflows (now only Cloudcraft is partially supported)
  • Consider contributing to Terraform AWS modules if you familiar with Terraform already

Developer's guide

AWS Lambda supports Python 3.6, so you should use it also. Run this to install all required packages:

$ pip install -r requirements.txt

Serverless framework is used to do heavy-lifting by packaging dependencies required for AWS Lambda function (requirements-lambda.txt) and updating the code there. Read through Quick Start guide, as well as installation, various AWS functions, serverless.yml reference to familiarise yourself with the usage of the framework.

As a short cheatsheet, you will need to use these commands:

  • Invoke real endpoint in dev and prod environments using httpie:
# dev
$ http --print Hhb --all --follow https://dev-lambda.modules.tf/ @input/blueprint_my.json

# prod
$ http --print Hhb --all --follow https://lambda.modules.tf/ @input/blueprint_my.json
  • Invoke function locally providing input.json:
$ serverless invoke local --function generate-cloudcraft --path test_fixtures/input_localfile.json
  • Deploy all functions to prod environment:
$ serverless deploy --stage prod
  • Deploy single function to dev environment:
$ serverless deploy function --function generate-cloudcraft --stage dev
  • Deploy single function to prod environment:
$ serverless deploy function --function generate-cloudcraft --stage prod

Authors

This project is created and maintained by Anton Babenko with the help from different contributors.

@antonbabenko

License

This work is licensed under MIT License. See LICENSE for full details.

Copyright (c) 2019 Anton Babenko

About

Infrastructure as code generator - from visual diagrams created with Cloudcraft.co to Terraform

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 76.6%
  • HCL 13.7%
  • Shell 9.7%