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.
This project was partially sponsored by Cloudcraft - the best way to draw AWS diagrams.
Monitoring of serverless applications provided by Dashbird.io.
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
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
andprod
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
This project is created and maintained by Anton Babenko with the help from different contributors.
This project exists thanks to all the people who contribute. [Contribute].
Become a financial contributor and help us sustain our community. [Contribute]
Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]
This work is licensed under MIT License. See LICENSE for full details.
Copyright (c) 2019 Anton Babenko