Skip to content
Infrastructure as code generator - from visual diagrams created with Cloudcraft.co to Terraform
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Moved PULL_REQUEST_TEMPLATE.md Sep 17, 2018
bin Fixed styling mostly Sep 15, 2018
input Fixed multiAZ in RDS Feb 18, 2019
misc
modules-metadata WIP VPC and HTTP POST Nov 2, 2018
modulestf Fixed multiAZ in RDS Feb 18, 2019
templates
test_fixtures Fixed multiAZ in RDS Feb 18, 2019
.editorconfig Fixed styling mostly Sep 15, 2018
.flake8
.gitignore
.pre-commit-config.yaml Fixed styling mostly Sep 15, 2018
CODE_OF_CONDUCT.md More updates everywhere Sep 13, 2018
CONTRIBUTING.md
LICENSE More updates everywhere Sep 13, 2018
README.md
handler.py Added CORS headers to response Nov 14, 2018
package-lock.json Upgraded serverless to 1.37.1 Feb 18, 2019
package.json Upgraded serverless to 1.37.1 Feb 18, 2019
requirements-lambda.txt
requirements.txt Added random names, set all values to sane defaults Nov 16, 2018
serverless.yml

README.md

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.

Sponsors

Cloudcraft - the best way to draw AWS diagrams

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

Don't hesitate to contact me if you want to become a sponsor or need custom features to be implemented.

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

You can’t perform that action at this time.